/* portal-auth.css — shared styles for the standalone portal auth pages
   (login, register, forgot-password, reset-password). Merged 2026-07-05 from the
   4 near-identical portal-*.css files (Phase 2, WIP-css-remediation). Page-specific
   blocks use distinct class names so they coexist; register's wider card + tighter
   field spacing are opt-in via `.login-card--wide` on its card element.
   The template sets --portal-accent once inline. */
* { box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--color-brand-gradient-a) 0%, var(--color-brand-gradient-b) 100%);
    min-height: calc(100vh / var(--app-zoom, 1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
}

/* ── Backgrounds (animated + video) ─────────────────────────────────────── */
#animated-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.32), transparent 36%),
        radial-gradient(circle at 76% 12%, rgba(168, 85, 247, 0.22), transparent 38%),
        radial-gradient(circle at 72% 80%, rgba(59, 130, 246, 0.25), transparent 42%),
        linear-gradient(130deg, var(--color-hero-slate-1) 0%, var(--color-hero-slate-2) 44%, var(--color-hero-slate-3) 100%);
    background-size: 140% 140%;
    animation: portal-bg-drift 20s ease-in-out infinite alternate;
}
@keyframes portal-bg-drift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
#video-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
#video-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
body.bg-animation #video-bg,
body.bg-animation #video-overlay { display: none; }
body:not(.bg-animation) #animated-bg { display: none; }

/* ── Card + logo ────────────────────────────────────────────────────────── */
.login-card {
    position: relative;
    z-index: 1;
    background: var(--color-surface);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(0,0,0,.2);
}
.login-card--wide { max-width: 480px; }  /* register: 2-column name row */
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--portal-accent);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.login-logo .logo-icon .material-icons { color: var(--color-on-accent); font-size: 28px; }
.login-logo img { height: 48px; display: block; margin: 0 auto 12px; }
.login-logo h1 { font-size: 20px; font-weight: 700; color: --color-text-primary; margin: 0 0 4px; }
.login-logo p { font-size: 13px; color: --color-text-faint; margin: 0; }

/* ── Fields ─────────────────────────────────────────────────────────────── */
.material-input-wrapper { margin-bottom: 16px; }
.login-card--wide .material-input-wrapper { margin-bottom: 14px; }  /* register */
.material-input-wrapper label { display: block; font-size: 13px; font-weight: 600; color: --color-text-secondary; margin-bottom: 6px; }
.material-input-wrapper label .optional { font-weight: 400; color: var(--color-text-faint); margin-left: 4px; }
.material-input-wrapper input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid --color-border-strong;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.material-input-wrapper input:focus {
    border-color: var(--portal-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

/* ── Submit button ──────────────────────────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 11px;
    background: var(--portal-accent);
    color: --color-on-accent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity .15s;
}
.btn-login:hover { opacity: .88; }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }

/* ── Status messages ────────────────────────────────────────────────────── */
.error-msg {
    background: var(--color-danger-bg, #fee2e2);
    color: var(--color-danger-text, #dc2626);
    border: 1px solid var(--color-danger-border-soft);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.error-msg .material-icons { font-size: 16px; flex-shrink: 0; }
.success-msg {
    background: --color-success-bg;
    color: --color-success-text;
    border: 1px solid var(--color-success-border-soft);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.success-msg .material-icons { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.warn-msg {
    background: --color-warning-bg;
    color: --color-warning-text;
    border: 1px solid var(--color-orange-border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.warn-msg .material-icons { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
/* Links inside status messages inherit the message colour + underline
   (was default browser blue; `.msg a` (0,1,1) beats the UA a:link rule). */
.error-msg a, .success-msg a, .warn-msg a { color: inherit; text-decoration: underline; }

/* ── Footer + links ─────────────────────────────────────────────────────── */
.divider { height: 1px; background: --color-border; margin: 20px 0; }
.portal-footer { margin-top: 24px; text-align: center; font-size: 12px; color: var(--color-text-faint); }
.portal-footer a { color: var(--portal-accent); text-decoration: none; font-weight: 500; }
.portal-footer a:hover { text-decoration: underline; }
.portal-links { margin-top: 16px; text-align: center; font-size: 13px; }
.portal-links a { color: var(--portal-accent); text-decoration: none; font-weight: 500; }
.portal-links a:hover { text-decoration: underline; }
.portal-links .divider-dot { color: --color-border-strong; margin: 0 8px; }
.portal-links-row { display: flex; justify-content: center; align-items: center; margin: 18px 0 6px; }
.portal-links-row a { color: var(--portal-accent); text-decoration: none; font-size: 13px; font-weight: 500; padding: 4px 8px; }
.portal-links-row a:hover { text-decoration: underline; }

/* ── Register-specific ──────────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tos-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: --color-text-secondary;
}
.tos-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--portal-accent);
}
.tos-row a { color: var(--portal-accent); text-decoration: none; }
.tos-row a:hover { text-decoration: underline; }
