/* Sign-in pages (Views/Shared/_LoginLayout.cshtml): login, new password, two-factor setup and code, recovery codes,
   forgot / reset password. Self-contained: the dashboard theme is not loaded on these pages. */

:root {
    --auth-brand: #BC3543;
    --auth-brand-hover: #A52D3A;
    --auth-brand-dark: #7B1C29;
    --auth-brand-soft: #FCEFF1;
    --auth-brand-ring: rgba(188, 53, 67, 0.16);
    --auth-ink: #1D2433;
    --auth-text: #344054;
    --auth-muted: #667085;
    --auth-faint: #98A2B3;
    --auth-line: #E4E7EC;
    --auth-input-line: #D0D5DD;
    --auth-bg: #F4F5F7;
    --auth-panel: #FAFBFC;
    --auth-success: #12805C;
    --auth-success-soft: #ECFDF3;
    --auth-error: #C0362C;
    --auth-error-soft: #FEF3F2;
    --auth-info: #1E40AF;
    --auth-info-soft: #EFF6FF;
    --auth-mono: Consolas, "SFMono-Regular", Menlo, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body.auth-body {
    margin: 0;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--auth-ink);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
}

.auth-body a { color: var(--auth-brand); font-weight: 500; text-decoration: none; }
.auth-body a:hover { color: var(--auth-brand-hover); text-decoration: underline; }

.auth-svg { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }

/* ---------- Page layout: brand panel + form ---------- */

.auth-shell { display: flex; min-height: 100vh; }

.auth-brand {
    position: relative;
    flex: 0 0 42%;
    max-width: 580px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px 36px;
    color: #fff;
    background: linear-gradient(155deg, #4E111A 0%, var(--auth-brand-dark) 38%, var(--auth-brand) 100%);
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand::before {
    width: 520px; height: 520px; right: -220px; top: -160px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 70%);
}

.auth-brand::after {
    width: 420px; height: 420px; left: -160px; bottom: -180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 70%);
}

.auth-brand > * { position: relative; z-index: 1; }

/* Dot grid in the top right corner, fading out */
.auth-brand::after {
    width: 300px;
    height: 240px;
    left: auto;
    right: 28px;
    top: 30px;
    bottom: auto;
    border-radius: 0;
    background: radial-gradient(rgba(255, 255, 255, 0.28) 1.2px, transparent 1.7px) 0 0 / 18px 18px;
    -webkit-mask-image: radial-gradient(ellipse at 75% 25%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 75% 25%, #000 0%, transparent 70%);
}

/* Wireframe globe with connection points (decoration, behind the text) */
.auth-brand > .auth-art {
    position: absolute;
    z-index: 0;
    right: -150px;
    bottom: -160px;
    width: 620px;
    height: 620px;
    pointer-events: none;
}

.auth-art-globe circle,
.auth-art-globe ellipse { fill: none; stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.2; }
.auth-art-globe > circle { stroke: rgba(255, 255, 255, 0.38); stroke-width: 1.6; }

.auth-art-orbit ellipse { fill: none; stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.2; stroke-dasharray: 2 7; }
.auth-art-satellite { fill: #fff; }

.auth-art-links path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 3 7;
    animation: auth-flow 3.5s linear infinite;
}

.auth-art-nodes circle { fill: #fff; }

.auth-art-nodes .auth-art-pulse {
    fill: rgba(255, 255, 255, 0.22);
    transform-box: fill-box;
    transform-origin: center;
    animation: auth-pulse 3.2s ease-out infinite;
}

.auth-art-nodes .auth-art-delay1 { animation-delay: 0.8s; }
.auth-art-nodes .auth-art-delay2 { animation-delay: 1.6s; }
.auth-art-nodes .auth-art-delay3 { animation-delay: 2.4s; }

@keyframes auth-flow { to { stroke-dashoffset: -40; } }

@keyframes auth-pulse {
    0% { transform: scale(0.45); opacity: 0.95; }
    100% { transform: scale(1.9); opacity: 0; }
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    padding: 12px 18px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.auth-brand-logo img { height: 34px; width: auto; display: block; }

.auth-brand h2 {
    margin: 44px 0 12px;
    font-size: 36px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.auth-brand p {
    margin: 0;
    max-width: 380px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.82);
}

.auth-brand-foot { font-size: 13px; color: rgba(255, 255, 255, 0.7); text-shadow: 0 1px 6px rgba(78, 17, 26, 0.9); }

.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px 36px 32px;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 16px 40px rgba(16, 24, 40, 0.08);
}

.auth-card-logo { display: none; text-align: center; margin-bottom: 24px; }
.auth-card-logo img { height: 32px; width: auto; }

.auth-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    font-size: 12px;
    color: var(--auth-faint);
}

.auth-footer img { height: 22px; width: auto; display: block; }

@media (max-width: 960px) {
    .auth-brand { display: none; }
    .auth-card-logo { display: block; }
}

@media (max-width: 480px) {
    .auth-main { justify-content: flex-start; padding: 24px 16px; }
    .auth-card { padding: 28px 20px 24px; border-radius: 14px; }
}

/* ---------- Card content ---------- */

.auth-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 14px;
    color: var(--auth-brand);
    background: var(--auth-brand-soft);
}

.auth-icon .auth-svg { width: 26px; height: 26px; }
.auth-icon.success { color: var(--auth-success); background: var(--auth-success-soft); }
.auth-icon.error { color: var(--auth-error); background: var(--auth-error-soft); }

.auth-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--auth-ink);
}

.auth-subtitle { margin: 0 0 24px; font-size: 14.5px; color: var(--auth-muted); }
.auth-subtitle strong { color: var(--auth-ink); font-weight: 600; overflow-wrap: anywhere; }

.auth-field { margin-bottom: 18px; }

.auth-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-label a { font-size: 13px; }

.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    color: var(--auth-ink);
    background: #fff;
    border: 1px solid var(--auth-input-line);
    border-radius: 10px;
    outline: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder { color: var(--auth-faint); }
.auth-input:focus { border-color: var(--auth-brand); box-shadow: 0 0 0 4px var(--auth-brand-ring); }
.auth-input.input-validation-error { border-color: var(--auth-error); }
.auth-input.input-validation-error:focus { box-shadow: 0 0 0 4px rgba(192, 54, 44, 0.14); }

.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 48px; }

.auth-eye {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--auth-muted);
    background: transparent;
    cursor: pointer;
}

.auth-eye:hover { color: var(--auth-ink); background: #F2F4F7; }
.auth-eye:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--auth-brand-ring); }
.auth-eye .auth-eye-hide { display: none; }
.auth-eye.is-visible .auth-eye-show { display: none; }
.auth-eye.is-visible .auth-eye-hide { display: inline-block; }

/* One-time codes */
.auth-code {
    height: 58px;
    padding: 0 0 0 0.45em;
    text-align: center;
    font-family: var(--auth-mono);
    font-size: 26px;
    letter-spacing: 0.45em;
}

.auth-code::placeholder { letter-spacing: 0.35em; }
.auth-code.is-recovery { font-size: 20px; letter-spacing: 0.14em; padding-left: 0.14em; text-transform: uppercase; }
.auth-code.is-recovery::placeholder { letter-spacing: 0.12em; }

/* Validation (jQuery unobtrusive + server messages) */
.field-validation-error { display: block; margin-top: 6px; font-size: 13px; color: var(--auth-error); }
.field-validation-valid { display: none; }
.validation-summary-valid { display: none; }

.auth-alert,
.auth-summary.validation-summary-errors {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid;
    border-radius: 10px;
}

.auth-summary.validation-summary-errors { color: #912018; background: var(--auth-error-soft); border-color: #FECDCA; }
.auth-summary ul { margin: 0; padding: 0; list-style: none; }
.auth-alert.info { color: var(--auth-info); background: var(--auth-info-soft); border-color: #D1E0FB; }
.auth-alert.error { color: #912018; background: var(--auth-error-soft); border-color: #FECDCA; }
.auth-alert.warning { color: #93370D; background: #FFFAEB; border-color: #FEDF89; }
.auth-alert.success { color: #05603A; background: var(--auth-success-soft); border-color: #ABEFC6; }
.auth-alert .auth-svg { width: 18px; height: 18px; margin-top: 1px; }

/* Buttons */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    padding: 0 18px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--auth-brand);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.auth-body a.auth-btn { color: #fff; text-decoration: none; }
.auth-btn:hover, .auth-body a.auth-btn:hover { background: var(--auth-brand-hover); color: #fff; text-decoration: none; }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(188, 53, 67, 0.28); }
.auth-btn:disabled, .auth-btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.auth-btn.secondary,
.auth-body a.auth-btn.secondary {
    width: auto;
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-text);
    background: #fff;
    border: 1px solid var(--auth-input-line);
}

.auth-btn.secondary:hover, .auth-body a.auth-btn.secondary:hover { color: var(--auth-ink); background: #F9FAFB; }
.auth-btn.secondary .auth-svg { width: 16px; height: 16px; }

.auth-btn.is-loading { pointer-events: none; }
.auth-btn.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-links { margin-top: 20px; text-align: center; font-size: 14px; color: var(--auth-muted); }
.auth-links a { display: inline-flex; align-items: center; gap: 6px; }
.auth-links .auth-svg { width: 16px; height: 16px; }

.auth-help { margin: 18px 0 0; font-size: 13px; color: var(--auth-muted); text-align: center; }

.auth-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

/* ---------- Setup steps ---------- */

.auth-steps { display: flex; list-style: none; margin: 0 0 28px; padding: 0; }

.auth-steps li {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--auth-faint);
    text-align: center;
}

.auth-steps li::before {
    content: "";
    position: absolute;
    top: 13px;
    left: calc(-50% + 18px);
    right: calc(50% + 18px);
    height: 2px;
    background: var(--auth-line);
}

.auth-steps li:first-child::before { display: none; }
.auth-steps li.done::before, .auth-steps li.current::before { background: var(--auth-brand); }

.auth-step-dot {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-faint);
    background: #fff;
    border: 2px solid var(--auth-line);
    border-radius: 50%;
}

.auth-step-dot .auth-svg { width: 14px; height: 14px; }
.auth-steps li.current { color: var(--auth-ink); }
.auth-steps li.current .auth-step-dot { color: var(--auth-brand); border-color: var(--auth-brand); box-shadow: 0 0 0 4px var(--auth-brand-ring); }
.auth-steps li.done { color: var(--auth-text); }
.auth-steps li.done .auth-step-dot { color: #fff; background: var(--auth-brand); border-color: var(--auth-brand); }

/* ---------- Authenticator setup ---------- */

.auth-howto { counter-reset: howto; list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }

.auth-howto li {
    counter-increment: howto;
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: var(--auth-text);
}

.auth-howto li::before {
    content: counter(howto);
    flex: 0 0 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-brand);
    background: var(--auth-brand-soft);
    border-radius: 50%;
}

.auth-setup {
    margin-bottom: 22px;
    padding: 20px;
    text-align: center;
    background: var(--auth-panel);
    border: 1px solid var(--auth-line);
    border-radius: 14px;
}

.auth-qr {
    width: 184px;
    height: 184px;
    margin: 0 auto 16px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
}

.auth-qr svg { display: block; width: 100%; height: 100%; }

.auth-key-label { margin-bottom: 8px; font-size: 13px; color: var(--auth-muted); }

.auth-key { display: flex; align-items: stretch; gap: 8px; }

.auth-key code {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 6px 10px;
    font-family: var(--auth-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--auth-ink);
    overflow-wrap: anywhere; /* wraps between the 4-character groups */
    background: #fff;
    border: 1px dashed var(--auth-input-line);
    border-radius: 8px;
}

/* ---------- Recovery codes ---------- */

.auth-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 14px;
    padding: 14px;
    list-style: none;
    background: var(--auth-panel);
    border: 1px solid var(--auth-line);
    border-radius: 14px;
}

.auth-codes li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-family: var(--auth-mono);
    font-size: 15px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    color: var(--auth-ink);
    background: #fff;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
}

.auth-codes li span { min-width: 18px; font-size: 11px; letter-spacing: 0; color: var(--auth-faint); }

@media (max-width: 460px) {
    .auth-codes { gap: 6px; padding: 10px; }
    .auth-codes li { gap: 6px; padding: 8px; font-size: 13.5px; letter-spacing: 0.03em; }
    .auth-codes li span { min-width: 14px; }
}

@media (max-width: 340px) { .auth-codes { grid-template-columns: 1fr; } }

.auth-actions { display: flex; gap: 8px; margin-bottom: 18px; }

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--auth-text);
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    cursor: pointer;
}

.auth-check:hover { background: var(--auth-panel); }
.auth-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--auth-brand); flex: 0 0 auto; }
.auth-check strong { display: block; font-weight: 600; }
.auth-check small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--auth-muted); }

@media (prefers-reduced-motion: reduce) {
    .auth-btn, .auth-input { transition: none; }
    .auth-btn.is-loading::after { animation-duration: 2s; }
    .auth-art-links path, .auth-art-nodes .auth-art-pulse { animation: none; }
    .auth-art-nodes .auth-art-pulse { opacity: 0.5; transform: none; }
    .auth-art-satellite { display: none; }
}
