/*
 * Fil: auth.css
 * Sti: /assets/css/auth.css
 * Version: 1.4.0
 * Since: 2026-05-16
 * Sidst opdateret: 2026-05-31
 *
 * Changelog:
 *  - 1.4.0:
 *      - Tilfoejer adgangsnoegle-knap paa login-siden.
 *  - 1.3.0:
 *      - Tilfoejer status- og linkstyling til glemt adgangskode-flow.
 *  - 1.2.1:
 *      - Bruger appens lokale fonte og giver login-kortet bedre desktop-bredde.
 *  - 1.2.0:
 *      - Forbedrer login-sidens layout, formularhierarki, mobilvisning og dark mode.
 *  - 1.1.0:
 *      - Tilføjer dark mode-styling til auth-sidernes fejlbeskeder.
 *  - 1.0.0:
 *      - Flytter auth-sidernes inline CSS til en dedikeret stylesheet.
 */

@import url('/assets/css/fonts.css?v=20260520-1');

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

.auth-page {
    min-height      : 100dvh;
    margin          : 0;
    padding         : max(1.5rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
    color           : #1f2937;
    background      : radial-gradient(circle at top left, rgba(13, 110, 253, .13), transparent 32rem),
                      linear-gradient(180deg, #f7fbff 0%, #eef3f8 100%);
    font-family     : "Google Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.auth-shell {
    display    : grid;
    min-height : calc(100dvh - max(3rem, env(safe-area-inset-top)) - max(3rem, env(safe-area-inset-bottom)));
    place-items: center;
}

.auth-card {
    width          : min(100%, 32rem);
    padding        : clamp(1.25rem, 4vw, 2rem);
    background     : rgba(255, 255, 255, .9);
    border         : 1px solid rgba(13, 110, 253, .12);
    border-radius  : 1rem;
    box-shadow     : 0 1.25rem 3rem rgba(15, 23, 42, .14);
    backdrop-filter: blur(16px);
}

.auth-brand {
    display              : grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap                  : 1rem;
    align-items          : center;
    margin-bottom        : 1.35rem;
    text-align           : left;
}

.auth-brand-mark {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    width          : 4rem;
    height         : 4rem;
    background     : #0d6efd;
    border-radius  : 1rem;
    box-shadow     : 0 .8rem 1.75rem rgba(13, 110, 253, .26);
}

.auth-brand-mark img {
    width : 2.5rem;
    height: 2.5rem;
}

.auth-kicker {
    margin        : 0 0 .25rem;
    color         : #0b5cab;
    font-size     : .8rem;
    font-weight   : 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin     : 0;
    color      : #111827;
    font-size  : clamp(1.7rem, 5vw, 2.2rem);
    font-weight: 800;
    line-height: 1.08;
}

.auth-copy {
    margin     : .45rem 0 0;
    color      : #6b7280;
    font-size  : .98rem;
    line-height: 1.45;
}

.auth-form {
    display: grid;
    gap    : .8rem;
}

.form-signin-wide {
    max-width: 420px;
}

.form-signin .form-floating:focus-within {
    z-index: 2;
}

.auth-field .form-control {
    min-height    : 3.4rem;
    border-color  : rgba(15, 23, 42, .14);
    border-radius : .75rem;
    box-shadow    : none;
    font-weight   : 650;
}

.auth-field .form-control:focus {
    border-color: rgba(13, 110, 253, .6);
    box-shadow  : 0 0 0 .25rem rgba(13, 110, 253, .12);
}

.auth-field label {
    color      : #6b7280;
    font-weight: 650;
}

.auth-password-row {
    display              : grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap                  : .55rem;
    align-items          : stretch;
}

.auth-password-toggle {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    gap            : .35rem;
    min-width      : 4.9rem;
    padding        : 0 .75rem;
    color          : #0d6efd;
    background     : #eef5ff;
    border         : 1px solid rgba(13, 110, 253, .2);
    border-radius  : .75rem;
    font-weight    : 750;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color       : #0b5ed7;
    background  : #e1efff;
    border-color: rgba(13, 110, 253, .34);
}

.auth-options {
    display        : flex;
    align-items    : center;
    justify-content: space-between;
    gap            : 1rem;
    color          : #4b5563;
    font-size      : .95rem;
    font-weight    : 650;
}

.auth-secondary-actions {
    display        : flex;
    justify-content: center;
    margin-top     : 1rem;
}

.auth-inline-link {
    color          : #0b5cab;
    font-weight    : 750;
    text-decoration: none;
    white-space    : nowrap;
}

.auth-inline-link:hover,
.auth-inline-link:focus-visible {
    color          : #0a58ca;
    text-decoration: underline;
}

.auth-options .form-check-input {
    width : 1.05rem;
    height: 1.05rem;
}

.auth-submit {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    gap            : .55rem;
    min-height     : 3rem;
    border-radius  : .75rem;
    font-weight    : 800;
    box-shadow     : 0 .8rem 1.5rem rgba(13, 110, 253, .24);
}

.auth-submit-spinner {
    display: none;
}

.auth-submit.is-loading .auth-submit-spinner {
    display: inline-block;
}

.auth-submit.is-loading {
    pointer-events: none;
}

.auth-divider {
    display    : flex;
    align-items: center;
    gap        : .8rem;
    color      : #6b7280;
    font-size  : .85rem;
    font-weight: 750;
}

.auth-divider::before,
.auth-divider::after {
    content         : "";
    height          : 1px;
    flex            : 1 1 0;
    background-color: rgba(15, 23, 42, .13);
}

.auth-passkey-button {
    display        : inline-flex;
    align-items    : center;
    justify-content: center;
    gap            : .55rem;
    min-height     : 3rem;
    color          : #0b5cab;
    background     : #eef5ff;
    border         : 1px solid rgba(13, 110, 253, .22);
    border-radius  : .75rem;
    font-weight    : 800;
}

.auth-passkey-button:hover,
.auth-passkey-button:focus-visible {
    color       : #084f97;
    background  : #e1efff;
    border-color: rgba(13, 110, 253, .38);
}

.auth-passkey-button.is-loading {
    pointer-events: none;
    opacity       : .78;
}

.login-error {
    display        : flex;
    align-items    : flex-start;
    gap            : .55rem;
    margin-bottom  : 1rem;
    padding        : .75rem .85rem;
    color          : #842029;
    background     : #fff1f1;
    border         : 1px solid #f1b8b8;
    border-radius  : .75rem;
    font-weight    : 700;
    text-align     : left;
}

.login-error i {
    flex       : 0 0 auto;
    margin-top : .1rem;
    line-height: 1;
}

.login-success {
    display        : flex;
    align-items    : flex-start;
    gap            : .55rem;
    margin-bottom  : 1rem;
    padding        : .75rem .85rem;
    color          : #0f5132;
    background     : #eaf7ef;
    border         : 1px solid #a9d8bb;
    border-radius  : .75rem;
    font-weight    : 700;
    text-align     : left;
}

.login-success i {
    flex       : 0 0 auto;
    margin-top : .1rem;
    line-height: 1;
}

@media (max-width: 430px) {
    .auth-page {
        padding-right: .85rem;
        padding-left : .85rem;
    }

    .auth-brand {
        grid-template-columns: 1fr;
        justify-items        : center;
        text-align           : center;
    }

    .auth-password-row {
        grid-template-columns: 1fr;
    }

    .auth-password-toggle {
        min-height: 2.75rem;
    }

    .auth-options {
        align-items   : flex-start;
        flex-direction: column;
        gap           : .55rem;
    }
}

html[data-bs-theme="dark"] .login-error {
    color           : #f8d7da;
    background-color: rgba(220, 53, 69, .16);
    border-color    : rgba(220, 53, 69, .34);
}

html[data-bs-theme="dark"] .login-success {
    color           : #d1e7dd;
    background-color: rgba(25, 135, 84, .16);
    border-color    : rgba(25, 135, 84, .34);
}

html[data-bs-theme="dark"] .auth-page {
    color     : #e5e7eb;
    background: radial-gradient(circle at top left, rgba(96, 165, 250, .16), transparent 32rem),
                linear-gradient(180deg, #0f141b 0%, #111827 100%);
}

html[data-bs-theme="dark"] .auth-card {
    background  : rgba(22, 27, 34, .92);
    border-color: rgba(96, 165, 250, .18);
    box-shadow  : 0 1.25rem 3rem rgba(0, 0, 0, .34);
}

html[data-bs-theme="dark"] .auth-kicker,
html[data-bs-theme="dark"] .auth-password-toggle,
html[data-bs-theme="dark"] .auth-inline-link {
    color: #9ec5fe;
}

html[data-bs-theme="dark"] .auth-brand h1 {
    color: #f8fafc;
}

html[data-bs-theme="dark"] .auth-copy,
html[data-bs-theme="dark"] .auth-options,
html[data-bs-theme="dark"] .auth-field label {
    color: #a7b0bd;
}

html[data-bs-theme="dark"] .auth-field .form-control {
    color           : #f8fafc;
    background-color: #111820;
    border-color    : #30363d;
}

html[data-bs-theme="dark"] .auth-password-toggle {
    background  : rgba(96, 165, 250, .12);
    border-color: rgba(96, 165, 250, .22);
}

html[data-bs-theme="dark"] .auth-password-toggle:hover,
html[data-bs-theme="dark"] .auth-password-toggle:focus-visible {
    color     : #cfe2ff;
    background: rgba(96, 165, 250, .18);
}

html[data-bs-theme="dark"] .auth-divider {
    color: #a7b0bd;
}

html[data-bs-theme="dark"] .auth-divider::before,
html[data-bs-theme="dark"] .auth-divider::after {
    background-color: #30363d;
}

html[data-bs-theme="dark"] .auth-passkey-button {
    color       : #9ec5fe;
    background  : rgba(96, 165, 250, .12);
    border-color: rgba(96, 165, 250, .22);
}

html[data-bs-theme="dark"] .auth-passkey-button:hover,
html[data-bs-theme="dark"] .auth-passkey-button:focus-visible {
    color     : #cfe2ff;
    background: rgba(96, 165, 250, .18);
}
