/* Smart Intake — two-factor / auth shell (matches auth/login.html) */

body.is-login main.container,
body.is-tfa main.container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* ---- Slim header (login chrome) ---- */
.login-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 18px max(var(--space-5), 4vw);
    position: relative;
    z-index: 2;
}

.login-chrome__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink, #1e3d58);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.login-chrome__mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(5, 125, 205, 0.28);
    flex-shrink: 0;
}

.login-chrome__mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-chrome__org {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink, #1e3d58);
    opacity: 0.55;
}

/* ---- Centered card layout ---- */
.login-page,
.tfa-profile-page {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5) var(--space-4) var(--space-8);
    position: relative;
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% 38%, rgba(67, 176, 241, 0.22) 0%, transparent 68%),
        radial-gradient(ellipse 50% 40% at 80% 80%, rgba(5, 125, 205, 0.10) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.login-card,
.tfa-card {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    padding: var(--space-6) var(--space-5) var(--space-5);
    animation: tfa-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tfa-card--wide {
    width: min(560px, 100%);
}

.tfa-profile-page .tfa-card {
    width: min(720px, 100%);
    margin: 32px auto;
    animation: none;
}

@keyframes tfa-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-card__header {
    text-align: center;
    margin-bottom: var(--space-4);
}

.login-card__logo {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(5, 125, 205, 0.28);
}

.login-card__logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tfa-card h1,
.tfa-card .login-card__title {
    margin: 0 0 6px;
    font-size: var(--fs-2xl, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ink, #1e3d58);
    text-align: center;
}

.tfa-card__lead {
    margin: 0 0 var(--space-4);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink, #1e3d58);
    opacity: 0.65;
    text-align: center;
}

.tfa-step-badge {
    display: inline-block;
    margin: 0 auto var(--space-3);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary, #057dcd);
    background: rgba(5, 125, 205, 0.10);
    border-radius: 999px;
}

.tfa-card__header {
    text-align: center;
    margin-bottom: var(--space-4);
}

/* ---- Form fields (shared with login) ---- */
.login-form,
.tfa-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.login-field__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink, #1e3d58);
    opacity: 0.6;
}

.login-field__wrap {
    position: relative;
    display: block;
}

.login-field__icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink, #1e3d58);
    opacity: 0.38;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.login-field__wrap:focus-within .login-field__icon {
    opacity: 0.75;
    color: var(--primary, #057dcd);
}

.tfa-form .login-field__wrap .login-field__input,
.tfa-form .login-field__wrap input[type="text"],
.tfa-form .login-field__wrap input[type="password"],
.login-form .login-field__wrap .login-field__input,
.login-form .login-field__wrap input[type="text"],
.login-form .login-field__wrap input[type="password"] {
    padding-left: 42px;
}

.login-field__input--pw {
    padding-right: 14px;
}

.login-field__input,
.tfa-form input[type="text"],
.tfa-form input[type="password"],
.tfa-form input[type="number"] {
    width: 100%;
    padding: 12px 14px 12px 14px;
    font: inherit;
    font-size: 15px;
    border: 1.5px solid rgba(30, 61, 88, 0.16);
    border-radius: var(--radius-md, 10px);
    background: rgba(255, 255, 255, 0.80);
    color: var(--ink, #1e3d58);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field__input:focus,
.tfa-form input:focus {
    outline: none;
    border-color: var(--primary, #057dcd);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(5, 125, 205, 0.14);
}

.tfa-form input.tfa-otp-input {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding-left: 14px;
    padding-right: 14px;
    text-indent: 0.4em;
}

/* Inline "remember me" checkbox (2FA "don't ask for X days") */
.tfa-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 0;
    background: rgba(5, 125, 205, 0.05);
    border: 1px solid rgba(5, 125, 205, 0.14);
    border-radius: var(--radius-md, 10px);
    cursor: pointer;
    font-size: 13px;
    color: var(--ink, #1e3d58);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tfa-check:hover {
    background: rgba(5, 125, 205, 0.08);
    border-color: rgba(5, 125, 205, 0.28);
}

.tfa-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary, #057dcd);
    flex-shrink: 0;
    cursor: pointer;
}

.tfa-check__label {
    line-height: 1.4;
}

.login-error,
.tfa-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-md, 10px);
    font-size: 13px;
    line-height: 1.45;
}

.login-error,
.tfa-alert--error {
    background: rgba(220, 80, 80, 0.10);
    color: #b91c1c;
    border: 1px solid rgba(220, 80, 80, 0.28);
}

.tfa-alert--warn {
    background: rgba(180, 120, 0, 0.10);
    color: #92400e;
    border: 1px solid rgba(180, 120, 0, 0.25);
}

.tfa-alert--success {
    background: rgba(22, 163, 74, 0.10);
    color: #166534;
    border: 1px solid rgba(22, 163, 74, 0.25);
}

.login-submit,
.tfa-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: var(--space-1);
    padding: 13px 20px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(145deg, var(--primary, #057dcd), #0369a1);
    border: none;
    border-radius: var(--radius-md, 10px);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(5, 125, 205, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    text-decoration: none;
}

.login-submit:hover,
.tfa-btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 20px rgba(5, 125, 205, 0.40);
    transform: translateY(-1px);
    color: #fff;
}

.tfa-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink, #1e3d58);
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(30, 61, 88, 0.18);
    border-radius: var(--radius-md, 10px);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tfa-btn-secondary:hover {
    background: #fff;
    border-color: var(--primary, #057dcd);
    color: var(--primary, #057dcd);
}

.tfa-btn-ghost {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink, #1e3d58);
    opacity: 0.7;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.tfa-btn-ghost:hover {
    opacity: 1;
    color: var(--primary, #057dcd);
}

.tfa-btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(145deg, #dc2626, #b91c1c);
    border: none;
    border-radius: var(--radius-md, 10px);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}

.tfa-wizard-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.tfa-wizard-actions .tfa-btn-primary {
    flex: 1 1 auto;
    min-width: 120px;
}

.tfa-wizard-actions .tfa-btn-secondary {
    flex: 0 0 auto;
}

.tfa-wizard-actions .tfa-btn-ghost {
    margin-left: auto;
}

.tfa-divider {
    border: none;
    border-top: 1px solid rgba(30, 61, 88, 0.10);
    margin: var(--space-4) 0;
}

/* QR + secret */
.tfa-qr-wrap {
    display: flex;
    justify-content: center;
    margin: var(--space-3) 0;
    padding: var(--space-3);
    background: #fff;
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 2px 12px rgba(30, 61, 88, 0.08);
}

.tfa-qr-wrap img {
    display: block;
    max-width: 200px;
    height: auto;
}

.tfa-secret {
    word-break: break-all;
    font-family: ui-monospace, monospace;
    font-size: 13px;
    padding: 10px 12px;
    background: rgba(30, 61, 88, 0.06);
    border-radius: 8px;
    margin: var(--space-2) 0 var(--space-3);
}

.tfa-secret a {
    color: var(--primary, #057dcd);
    text-decoration: none;
}

/* Backup codes */
.tfa-backup-list {
    list-style: none;
    margin: 0 0 var(--space-4);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.tfa-backup-list li {
    font-family: ui-monospace, monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: center;
    padding: 10px 8px;
    background: rgba(5, 125, 205, 0.08);
    border: 1px solid rgba(5, 125, 205, 0.15);
    border-radius: 8px;
    color: var(--ink, #1e3d58);
}

.tfa-profile-section {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(30, 61, 88, 0.10);
}

.tfa-profile-section h2 {
    margin: 0 0 var(--space-2);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink, #1e3d58);
}

.tfa-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.tfa-method-list {
    margin: var(--space-3) 0;
}

.tfa-method-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1.5px solid rgba(30, 61, 88, 0.14);
    border-radius: var(--radius-md, 10px);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.tfa-method-list label:has(input:checked) {
    border-color: var(--primary, #057dcd);
    background: rgba(5, 125, 205, 0.06);
}

.field-error {
    font-size: 12px;
    color: #b91c1c;
    margin-top: 4px;
}

.login-foot {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(30, 61, 88, 0.10);
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink, #1e3d58);
    opacity: 0.5;
}

@media (max-width: 480px) {
    .login-chrome { padding: 14px 16px; }
    .login-chrome__org { display: none; }
    .tfa-wizard-actions { flex-direction: column; }
    .tfa-wizard-actions .tfa-btn-ghost { margin-left: 0; }
}
