/* Static Identity pages (login, 2FA, account management) and the setup wizard – design "Anmelden".
   The Geist @font-face rules live in app.css (loaded on every page by App.razor); this file comes after Bootstrap. */

:root {
    --acc-bg: #f5f5f2;
    --acc-text: #1c1d1f;
    --acc-muted: #6b6c70;
    --acc-faint: #8a8b8f;
    --acc-border: #d9d8d3;
    --acc-line: #e3e2dd;
    --acc-accent: #3f5bd6;
    --acc-accent-hover: #324bbf;
    --bs-body-font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --bs-link-color: #3f5bd6;
    --bs-link-hover-color: #2c45b0;
}

body {
    background: var(--acc-bg);
    color: var(--acc-text);
    font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: var(--acc-accent);
    text-decoration: none;
}

a:hover {
    color: #2c45b0;
    text-decoration: underline;
}

/* ---------- split layout (sign-in pages) ---------- */

.acc-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.acc-form-side {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 40px 56px;
}

.acc-form {
    width: 100%;
    max-width: 380px;
    align-self: center;
    margin: auto 0;
}

.acc-form h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.02em;
}

.acc-form h2 {
    font-size: 16px;
    font-weight: 600;
}

.acc-panel {
    background: #16181b;
    color: #e8e8e6;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 28px;
}

.acc-panel-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
}

.acc-panel-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9da1a8;
}

.acc-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22a05b;
}

.acc-panel-title {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: -.02em;
}

.acc-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: #2a2d31;
    border: 1px solid #2a2d31;
    border-radius: 10px;
    overflow: hidden;
    max-width: 520px;
}

.acc-facts > div {
    background: #1b1d21;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.acc-facts span {
    font-size: 12px;
    color: #8f939a;
}

.acc-facts b {
    font-size: 20px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .acc-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .acc-panel {
        display: none;
    }

    .acc-form-side {
        padding: 28px 20px;
        min-height: 100vh;
    }
}

/* ---------- card layout (account management, setup, errors) ---------- */

.acc-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px 24px;
}

.acc-header {
    margin-bottom: 24px;
}

.acc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -.01em;
    color: var(--acc-text);
    text-decoration: none;
}

.acc-brand:hover {
    color: var(--acc-text);
    text-decoration: none;
}

.acc-logo {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--acc-accent);
    color: #fff;
}

.acc-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid #e6e5e1;
    border-radius: 12px;
    padding: 32px;
}

.acc-card:has(.acc-wide) {
    max-width: 980px;
}

.acc-card:has(.acc-medium) {
    max-width: 620px;
}

.acc-card h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.02em;
    margin-bottom: 6px;
}

.acc-card h2 {
    font-size: 16px;
    font-weight: 600;
}

.acc-card h3, .acc-card h4 {
    font-size: 15px;
    font-weight: 600;
}

.acc-card .lead, .acc-subtitle {
    color: var(--acc-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.acc-card hr, .acc-form hr {
    border-color: var(--acc-line);
    opacity: 1;
}

.acc-footer {
    margin-top: 24px;
    color: var(--acc-faint);
    font-size: 12px;
}

/* ---------- form controls (Bootstrap, restyled) ---------- */

.form-label, .form-check-label {
    font-size: 13px;
    font-weight: 500;
}

.form-control, .form-select {
    border: 1px solid var(--acc-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--acc-text);
}

.acc-input {
    height: 40px;
    padding: 0 12px;
}

.form-floating > .form-control, .form-floating > .form-select {
    height: 52px;
    min-height: 52px;
}

.form-floating > label {
    color: var(--acc-muted);
    font-size: 13px;
}

.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus {
    box-shadow: 0 0 0 3px rgba(63, 91, 214, .15);
    border-color: var(--acc-accent);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: transparent;
}

.form-check-input {
    width: 15px;
    height: 15px;
    margin-top: .2em;
}

.form-check-input:checked {
    background-color: var(--acc-accent);
    border-color: var(--acc-accent);
}

.darker-border-checkbox.form-check-input {
    border-color: #a4a39e;
}

.btn {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.btn-lg {
    height: 42px;
    padding: 0 16px;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--acc-accent);
    border-color: var(--acc-accent);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--acc-accent-hover) !important;
    border-color: var(--acc-accent-hover) !important;
}

.btn-outline-secondary {
    border-color: var(--acc-border);
    color: var(--acc-text);
    background: #fff;
    min-height: 42px;
}

.btn-outline-secondary:hover, .btn-outline-secondary:active {
    background: #fafaf8 !important;
    border-color: var(--acc-border) !important;
    color: var(--acc-text) !important;
}

.btn-link {
    color: var(--acc-accent);
}

.alert {
    border-radius: 10px;
    font-size: 13.5px;
}

.validation-message, .text-danger {
    color: #c42b31 !important;
    font-size: 12.5px;
}

.invalid {
    outline: 1px solid #c42b31;
}

.text-secondary {
    color: var(--acc-faint) !important;
}

/* ---------- account management ---------- */

.acc-manage {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .acc-manage {
        grid-template-columns: 1fr;
    }
}

.acc-manage .nav-pills .nav-link {
    color: #45464a;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 13.5px;
}

.acc-manage .nav-pills .nav-link:hover {
    background: #f3f3f0;
    text-decoration: none;
}

.acc-manage .nav-pills .nav-link.active {
    background: #eef1fc;
    color: var(--acc-accent);
    font-weight: 500;
}

.acc-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    text-decoration: none;
}

.acc-code {
    font-family: "Geist Mono", "Cascadia Code", Consolas, monospace;
    background: #16181b;
    color: #e8e8e6;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 12.5px;
    white-space: pre-wrap;
    word-break: break-all;
}

.acc-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 12.5px;
    color: var(--acc-muted);
}

.acc-steps span.active {
    color: var(--acc-accent);
    font-weight: 500;
}

/* ---------- sign-in: phone variant (design "Anmeldung", MobileApp v2) ----------
 * Only below 768 px. The toggle "Mit E-Mail und Passwort" / "Andere Optionen" is a visually hidden checkbox
 * (.acc-pw-toggle) before the fields and the other options; the page itself is static.
 */

.acc-m-only,
.acc-m-hero,
.acc-m-net,
.acc-pw-toggle {
    display: none;
}

/* The password placeholder belongs to the phone variant (no visible labels there). */
.acc-login .acc-pw-fields input[type="password"]::placeholder {
    color: transparent;
}

@media (max-width: 767.98px) {
    .acc-d-only {
        display: none !important;
    }

    /* Focusable, but not visible (the labels are the buttons). */
    .acc-pw-toggle {
        display: block;
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        opacity: 0;
    }

    .acc-m-only {
        display: revert;
    }

    .acc-hero {
        position: relative;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: hidden;
        background: radial-gradient(120% 70% at 50% 18%, #1d2c72 0%, #111b4a 45%, #0a1030 100%);
        color: #fff;
    }

    .acc-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(10, 16, 48, 0) 50%, rgba(8, 12, 36, .7) 100%);
    }

    .acc-hero .acc-m-net {
        display: block;
        position: absolute;
        inset: 0;
        pointer-events: none;
    }

    .acc-m-net canvas {
        width: 100%;
        height: 100%;
        display: block;
    }

    .acc-hero .acc-form-side {
        position: relative;
        z-index: 1;
        min-height: 100vh;
        min-height: 100dvh;
        gap: 0;
        padding: calc(env(safe-area-inset-top) + 72px) max(20px, env(safe-area-inset-right)) calc(34px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    }

    .acc-hero .acc-brand {
        display: none;
    }

    .acc-hero .acc-m-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .acc-m-mark {
        position: relative;
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: linear-gradient(145deg, #6a86ff 0%, #3f5bd6 55%, #2c45b0 100%);
        box-shadow: 0 10px 30px rgba(63, 91, 214, .5), inset 0 1px 0 rgba(255, 255, 255, .3);
    }

    .acc-m-mark .ring {
        position: absolute;
        left: 14px;
        top: 14px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: 2.5px solid #fff;
    }

    .acc-m-mark .core {
        position: absolute;
        left: 24px;
        top: 24px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #fff;
    }

    .acc-m-mark .sat {
        position: absolute;
        left: 36px;
        top: 11px;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: #b9c8ff;
        box-shadow: 0 0 0 2.5px #4f6be6;
    }

    .acc-m-brand {
        display: flex;
        align-items: baseline;
        gap: 6px;
        font-size: 18px;
        letter-spacing: .01em;
        color: #c3cdf5;
    }

    .acc-m-brand b {
        font-weight: 700;
        letter-spacing: .04em;
        color: #fff;
    }

    .acc-hero .acc-form {
        max-width: none;
        margin: auto 0 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .acc-hero .acc-form h1,
    .acc-m-headline {
        margin: 0 0 8px;
        text-align: center;
        font-size: 28px;
        font-weight: 600;
        letter-spacing: -.025em;
        line-height: 1.1;
        text-wrap: balance;
        color: #fff;
    }

    .acc-hero .alert {
        background: rgba(255, 255, 255, .12);
        border: 1px solid rgba(255, 255, 255, .22);
        color: #fff;
        margin: 0;
    }

    .acc-login {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .acc-login .acc-pw-fields,
    .acc-login .acc-options {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .acc-login .acc-pw-fields {
        display: none;
    }

    .acc-pw-toggle:checked ~ .acc-pw-fields {
        display: flex;
    }

    .acc-pw-toggle:checked ~ .acc-options {
        display: none;
    }

    .acc-pw-toggle:focus-visible ~ .acc-options .acc-m-pwlink,
    .acc-pw-toggle:focus-visible ~ .acc-pw-fields .acc-m-link:first-child {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .acc-login .mb-3,
    .acc-login .mb-4 {
        margin: 0 !important;
    }

    .acc-login .form-label:not(.form-check-label) {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .acc-hero .acc-input {
        height: 44px;
        border: 0;
        border-radius: 11px;
        background: #fff;
        padding: 0 14px;
        /* 16 px: iOS zooms into smaller fields. */
        font-size: 16px;
    }

    .acc-login .acc-pw-fields input[type="password"]::placeholder {
        color: #6c757d;
    }

    .acc-hero .form-check-label {
        color: rgba(255, 255, 255, .9);
    }

    .acc-hero .validation-message,
    .acc-hero .text-danger {
        color: #ffb4b6 !important;
    }

    .acc-hero .btn {
        width: 100%;
        min-height: 48px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .acc-hero .btn-primary,
    .acc-hero .acc-passkey {
        min-height: 50px;
        border: 0;
        background: #fff !important;
        color: #111b4a !important;
        font-size: 14.5px;
        font-weight: 600;
    }

    .acc-hero .acc-submit {
        min-height: 48px;
    }

    .acc-hero .btn-primary:hover,
    .acc-hero .btn-primary:focus,
    .acc-hero .btn-primary:active {
        background: #eef1fc !important;
        color: #111b4a !important;
    }

    .acc-hero .acc-ms {
        border: 1px solid rgba(255, 255, 255, .22);
        background: rgba(255, 255, 255, .08);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        color: #fff;
    }

    .acc-hero .acc-ms:disabled {
        opacity: .45;
        color: #fff;
    }

    .acc-ms-logo {
        display: grid;
        grid-template-columns: 8px 8px;
        gap: 2px;
        flex: none;
    }

    .acc-ms-logo span {
        width: 8px;
        height: 8px;
        background: #f25022;
    }

    .acc-ms-logo span:nth-child(2) { background: #7fba00; }
    .acc-ms-logo span:nth-child(3) { background: #00a4ef; }
    .acc-ms-logo span:nth-child(4) { background: #ffb900; }

    .acc-m-pwlink {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        text-decoration: underline;
        text-underline-offset: 3px;
        text-decoration-color: rgba(255, 255, 255, .5);
        cursor: pointer;
    }

    .acc-m-links {
        display: flex;
        justify-content: space-between;
    }

    .acc-m-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        gap: 2px;
        color: #fff;
        font-size: 12.5px;
        cursor: pointer;
        text-decoration: none;
    }

    .acc-m-link:hover {
        color: #fff;
        text-decoration: none;
    }

    .acc-m-link.dim {
        color: rgba(255, 255, 255, .82);
    }

    /* Face ID offer after the first password login (SetupPasskey). */
    .acc-hero .btn-link {
        color: #fff;
        min-height: 44px;
        text-decoration: underline;
        text-underline-offset: 3px;
        text-decoration-color: rgba(255, 255, 255, .5);
    }

    .acc-hero form + form {
        margin-top: 0 !important;
    }
}
