/* Auth pages — log ind, opret konto, glemt/nulstil adgangskode.
   Shared primitives for all four; login's split-panel layout is in login.css.

   These four pages each carried their own inline <style> block, which is how
   login came to be restyled while the other three stayed on the old purple
   gradient. Everything here comes from the base.css tokens, which the pages now
   load first.

   The card masthead deliberately matches the e-mail layout in
   services/email_service.py: the reset mail and the page it links to are one
   journey, and it is the journey where a recipient is deciding whether to
   trust the link they just clicked. */

.auth-page {
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
}

/* ---------------------------------------------------------------- the card */

.auth-card {
    width: 100%;
    max-width: 30rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.auth-masthead {
    background-color: var(--bg-header);
    padding: 1.125rem 1.75rem;
}

.auth-masthead-name {
    font-size: 1.1875rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.025em;
}

.auth-masthead-sub {
    font-size: 0.8125rem;
    color: #d1d5db;      /* 9.96:1 on --bg-header */
    padding-left: 0.625rem;
}

/* Matches the 4px accent stripe on every transactional e-mail. */
.auth-accent {
    height: 4px;
    line-height: 4px;
    font-size: 0;
    background-color: var(--primary-color);
}

.auth-body {
    padding: 1.75rem;
}

.auth-header {
    margin-bottom: 1.25rem;
}

.auth-header h1 {
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.auth-header p {
    margin: 0;
    color: var(--text-muted);       /* 10.03:1 */
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ------------------------------------------------------------- notice box */

/* Same construction as _info_box() in the e-mails: a tint with a 1px border in
   the same hue, no accent stripe. */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 0.875rem 1.125rem;
    margin-bottom: 1.375rem;
    color: var(--text-main);        /* 16.30:1 on the tint */
    font-size: 0.8125rem;
}

.info-box p {
    margin: 0 0 0.375rem 0;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box strong {
    color: var(--primary-color);    /* 9.52:1 on the tint */
}

.info-box ol,
.info-box ul {
    margin: 0 0 0.375rem 0;
    padding-left: 1.25rem;
    line-height: 1.7;
}

/* ------------------------------------------------------------------ forms */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label,
.auth-page label {
    display: block;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.auth-page input[type="text"],
.auth-page input[type="email"],
.auth-page input[type="password"] {
    width: 100%;
    padding: 0.75rem 0.9375rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-main);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-page input::placeholder {
    color: var(--text-muted);
    opacity: 1;                      /* Firefox dims placeholders by default */
}

.auth-page input:hover {
    border-color: var(--secondary-color);
}

.auth-page input:focus {
    outline: none;
    border-color: var(--primary-color);   /* 10.36:1, was #73AFB6 at 2.46:1 */
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.auth-page input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.auth-page input.error   { border-color: var(--danger-color); }
.auth-page input.success { border-color: var(--success-color); }

.validation-message {
    font-size: 0.75rem;
    margin-top: 0.3125rem;
    color: var(--danger-color);      /* 8.29:1 */
}

.validation-message.success {
    color: var(--success-color);
}

/* ---------------------------------------------------------------- buttons */

.submit-button,
.register-button,
.login-button {
    width: 100%;
    min-height: 3rem;
    padding: 0.875rem;
    background-color: var(--primary-color);
    color: #fff;                     /* 10.36:1 */
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.submit-button:hover:not(:disabled),
.register-button:hover:not(:disabled),
.login-button:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

/* Disabled controls are exempt from 1.4.3, but an unreadable "please wait"
   state is still a bad one. #3b4254 on #e5e7eb is 8.1:1 and unmistakably
   inert; the old #8B9BB3 with white text was 2.82:1. */
.submit-button:disabled,
.register-button:disabled,
.login-button:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* ----------------------------------------------------------------- alerts */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    border: 1px solid transparent;   /* coloured per variant: tint + same-hue border */
}

.alert-error,
.flash-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger-color);      /* 7.60:1 on the tint */
}

.alert-success,
.flash-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: var(--success-color);     /* 9.23:1 */
}

.alert-info,
.flash-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--primary-color);     /* 9.52:1 */
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;                  /* 6.84:1 — amber needs the dark text */
}

/* ------------------------------------------------------------------ links */

.auth-links,
.back-link,
.login-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-links a,
.back-link a,
.login-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover,
.back-link a:hover,
.login-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .auth-page {
        padding: 1rem 0.75rem;
    }

    .auth-body {
        padding: 1.25rem;
    }

    .auth-masthead {
        padding: 1rem 1.25rem;
    }
}
