:root {
    --brand: #228b22;          /* forestgreen, the original button colour */
    --brand-dark: #1a6e1a;
    --brand-soft: #e8f5e8;
    --accent: #1f6fb2;         /* PHED blue from the logo */
    --ink: #1c2a24;
    --muted: #5d6b64;
    --line: #dde4e0;
    --surface: #ffffff;
    --danger: #c0392b;
    --warning: #e8a317;
    --radius: 14px;
    --shadow: 0 24px 60px -20px rgba(16, 60, 30, .35), 0 6px 18px -8px rgba(16, 60, 30, .18);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 0% 0%, rgba(31, 111, 178, .18), transparent 60%),
        radial-gradient(900px 600px at 100% 100%, rgba(34, 139, 34, .22), transparent 60%),
        linear-gradient(160deg, #f4faf5 0%, #eaf2ee 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Card shell ---------- */

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 36px 36px 24px;
    position: relative;
    overflow: hidden;
    animation: rise .45s ease-out both;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand), #3fae49 50%, var(--accent));
}

.auth-logo { text-align: center; margin-bottom: 8px; }
.auth-logo img { width: 230px; max-width: 80%; height: auto; display: inline-block; }

.auth-title {
    margin: 8px 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -.01em;
}

.auth-subtitle {
    margin: 0 0 26px;
    text-align: center;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.5;
}

.auth-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: .82rem;
    color: var(--muted);
}

.auth-alt { margin: 18px 0 0; text-align: center; font-size: .9rem; color: var(--muted); }
.auth-alt a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* ---------- Form ---------- */

.auth-form { display: grid; gap: 18px; }

.field { display: grid; gap: 7px; }

.field-label { font-size: .85rem; font-weight: 600; color: var(--ink); }

.field-control { position: relative; display: block; }

.field-control input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 44px;
    font: inherit;
    font-size: .95rem;
    color: var(--ink);
    background: #f8faf9;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.field-control input::placeholder { color: #9aa6a0; }

.field-control input:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(34, 139, 34, .14);
}

.field-control input:disabled { opacity: .6; cursor: not-allowed; }

.field-icon, .field-toggle svg, .btn-arrow, .alert-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    color: #8a978f;
    pointer-events: none;
}

.field-control:focus-within .field-icon { color: var(--brand); }

.field-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8a978f;
    cursor: pointer;
}
.field-toggle:hover { color: var(--brand); background: var(--brand-soft); }
.field-toggle svg { width: 19px; height: 19px; }

.field-hint { font-size: .8rem; font-weight: 500; }
.field-hint.ok { color: var(--brand); }
.field-hint.bad { color: var(--danger); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    font: inherit;
    font-weight: 600;
    font-size: .98rem;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .08s, box-shadow .15s, background .15s;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #2a9a2a, var(--brand));
    box-shadow: 0 8px 18px -8px rgba(34, 139, 34, .7);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #259025, var(--brand-dark)); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 3px solid rgba(34, 139, 34, .35); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn-block { width: 100%; }

.btn-arrow { width: 18px; height: 18px; transition: transform .15s; }
.btn:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

/* ---------- Alert dialog ---------- */

.alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(12, 28, 18, .45);
    backdrop-filter: blur(3px);
    animation: fade .2s ease-out both;
}

.alert-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 18px;
    padding: 30px 28px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    animation: pop .25s cubic-bezier(.2, .9, .3, 1.2) both;
}

.alert-loader { width: 84px; height: 84px; object-fit: contain; margin-bottom: 6px; }

.alert-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 3px solid currentColor;
}
.alert-icon svg { width: 36px; height: 36px; stroke-width: 2.6; }

.alert-success .alert-icon { color: var(--brand); background: var(--brand-soft); }
.alert-info .alert-icon { color: var(--accent); background: #e8f1f9; }
.alert-warning .alert-icon { color: var(--warning); background: #fdf5e3; }

.alert-title { margin: 0 0 8px; font-size: 1.3rem; font-weight: 700; }
.alert-text { margin: 0 0 22px; color: var(--muted); line-height: 1.55; }
.alert-ok { min-width: 120px; }

/* ---------- Motion ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 480px) {
    .auth-card { padding: 30px 22px 20px; border-radius: 16px; }
    .auth-title { font-size: 1.3rem; }
}

/* ---------- Blazor framework bits ---------- */

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1.25rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }
