:root {
    --auth-bg-1: #6C5CE7;
    --auth-bg-2: #341f97;
    --auth-card-bg: #ffffff;
    --auth-text: #1a1a2e;
    --auth-muted: #6b7280;
    --auth-border: #e5e7eb;
    --auth-input-bg: #f9fafb;
    --auth-accent: #6C5CE7;
    --auth-accent-hover: #5b4bd6;
    --auth-error-bg: #fef2f2;
    --auth-error-text: #b91c1c;
    --auth-radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --auth-card-bg: #1a1a2e;
        --auth-text: #f1f2f6;
        --auth-muted: #9ca3af;
        --auth-border: #2d2d44;
        --auth-input-bg: #23233a;
        --auth-error-bg: #3a1a1a;
        --auth-error-text: #f87171;
    }
}

* { box-sizing: border-box; }

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--auth-text);
}

/* ── Animated 4-bar Copious mark — shared brand identity across Copious products ── */
@keyframes bar-grow-1 { 0%, 2%  { transform: scaleX(0); opacity: 0; } 20% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 1; } }
@keyframes bar-grow-2 { 0%, 6%  { transform: scaleX(0); opacity: 0; } 24% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 1; } }
@keyframes bar-grow-3 { 0%, 10% { transform: scaleX(0); opacity: 0; } 29% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 1; } }
@keyframes bar-grow-4 { 0%, 15% { transform: scaleX(0); opacity: 0; } 33% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 1; } }

.logo-bar { transform-box: fill-box; transform-origin: left center; }
.logo-bar:nth-child(1) { animation: bar-grow-1 3s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }
.logo-bar:nth-child(2) { animation: bar-grow-2 3s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }
.logo-bar:nth-child(3) { animation: bar-grow-3 3s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }
.logo-bar:nth-child(4) { animation: bar-grow-4 3s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }

/* ── Split-screen shell: branded visual left, form right ── */
.auth-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-visual {
    display: none;
    position: relative;
    width: 50%;
    overflow: hidden;
}

.auth-visual-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.65), rgba(52,31,151,0.55));
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 48px;
    color: #fff;
}

.auth-visual-copy h2 {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
}

.auth-visual-copy p {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.75);
    max-width: 420px;
    margin: 0;
}

.auth-visual-footer {
    font-size: .8rem;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

.auth-panel {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--auth-card-bg);
}

@media (min-width: 992px) {
    .auth-visual { display: flex; }
    .auth-panel { width: 50%; }
}

.auth-shell {
    width: 100%;
    max-width: 400px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-brand-mobile {
    margin-bottom: 28px;
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.auth-brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -.01em;
    color: #fff;
}

.auth-brand-name-dark {
    color: var(--auth-text);
}

.auth-brand-sub {
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

.auth-brand-mobile .auth-brand-sub {
    color: var(--auth-muted);
}

.auth-card {
    padding: 0;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--auth-text);
}

.auth-subtitle {
    font-size: .9rem;
    color: var(--auth-muted);
    margin: 0 0 24px;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--auth-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 6px;
}

.auth-field input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 9px;
    border: 1px solid var(--auth-border);
    background: var(--auth-input-bg);
    color: var(--auth-text);
    font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}

    .auth-field input:focus {
        outline: none;
        border-color: var(--auth-accent);
        box-shadow: 0 0 0 3px rgba(108,92,231,0.15);
    }

.auth-field .field-validation-error {
    display: block;
    font-size: .8rem;
    color: var(--auth-error-text);
    margin-top: 4px;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: .875rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
}

.auth-submit {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 9px;
    background: var(--auth-accent);
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s;
}

    .auth-submit:hover {
        background: var(--auth-accent-hover);
    }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: .875rem;
    color: var(--auth-muted);
}

    .auth-footer a {
        color: var(--auth-accent);
        text-decoration: none;
        font-weight: 600;
    }

    .auth-footer a:hover {
        text-decoration: underline;
    }

.auth-summary {
    background: var(--auth-error-bg);
    color: var(--auth-error-text);
    border-radius: 9px;
    padding: 10px 14px;
    font-size: .875rem;
    margin-bottom: 18px;
}

/* asp-validation-summary always renders this div (with an empty, hidden <li>
   inside) even when there's nothing to show — MVC marks that "no errors"
   state with this class, so hide it then instead of showing an empty
   colored bar on every normal page load. */
.auth-summary.validation-summary-valid { display: none; }

.auth-summary ul {
    margin: 0;
    padding-left: 18px;
}

.auth-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 18px;
}

.auth-qr-wrap img {
    width: 180px;
    height: 180px;
    border-radius: 10px;
    border: 1px solid var(--auth-border);
    padding: 10px;
    background: #fff;
}

.auth-key {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: .95rem;
    letter-spacing: .05em;
    background: var(--auth-input-bg);
    border: 1px dashed var(--auth-border);
    border-radius: 9px;
    padding: 10px;
    margin-bottom: 18px;
    word-break: break-all;
}

.auth-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-family: 'Courier New', monospace;
    background: var(--auth-input-bg);
    border-radius: 9px;
    padding: 16px;
    margin-bottom: 18px;
}
