/* Shared auth styles — simple (login) and register split layouts */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --auth-bg: #0a0a0b;
    --auth-card: #18181b;
    --auth-blue: #2563eb;
    --auth-blue-light: #3b82f6;
    --auth-blue-deep: #004ac6;
    --auth-text: #f4f3f1;
    --auth-muted: #82807a;
    --auth-border: rgba(255, 255, 255, 0.07);
    --auth-input-bg: #18181b;
    --auth-label: #b7b4ae;
    --auth-panel-light: #f1f5f9;
    --auth-panel-light-text: #0f172a;
    --auth-panel-light-muted: #64748b;
}

body.auth-simple {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-bg);
    font-family: 'Manrope', system-ui, sans-serif;
    position: relative;
    margin: 0;
    overflow-x: hidden;
}

body.auth-simple::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(37, 99, 235, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 30%, rgba(99, 102, 241, 0.06) 0%, transparent 55%);
    pointer-events: none;
}

body.auth-simple::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

body.auth-simple.auth-scroll {
    align-items: flex-start;
    padding: 32px 0;
    overflow-y: auto;
}

.auth-shell {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    animation: authFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-shell-wide { max-width: 440px; }

.auth-shell-legal { max-width: min(720px, 100%); }

.auth-page-footer {
    margin-top: 8px;
    text-align: center;
}

.auth-legal-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 10px;
    margin-bottom: 8px;
}

.auth-legal-nav a {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    text-decoration: none;
    font-weight: 500;
}

.auth-legal-nav a:hover {
    color: var(--auth-blue-light);
}

.auth-legal-sep {
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    user-select: none;
}

.auth-legal-doc {
    font-size: 14px;
    color: var(--auth-muted);
    line-height: 1.65;
}

.auth-legal-doc section + section {
    margin-top: 20px;
}

.auth-legal-doc h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--auth-text);
    margin: 0 0 8px;
}

.auth-legal-doc p {
    margin: 0 0 10px;
}

.auth-legal-doc ul {
    margin: 0;
    padding-left: 1.25rem;
}

.auth-legal-doc li + li {
    margin-top: 6px;
}

.auth-legal-doc a {
    color: var(--auth-blue-light);
    text-decoration: underline;
}

.auth-legal-doc a:hover {
    color: #60a5fa;
}

.auth-legal-lead {
    color: var(--auth-text);
    font-size: 14px;
}

.auth-legal-note {
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fcd34d;
    font-size: 13px;
}

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card {
    background: var(--auth-card);
    border-radius: 16px;
    padding: 36px 32px 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

body.auth-register {
    min-height: 100vh;
    display: flex;
    margin: 0;
    font-family: 'Manrope', system-ui, sans-serif;
    background: var(--auth-bg);
}

.auth-register-panel {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.auth-register-brand {
    flex: 1;
    background: var(--auth-panel-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
}

.auth-register-brand-logo {
    position: absolute;
    top: 32px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-register-brand-logo .brand-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--auth-panel-light-text);
    letter-spacing: -0.3px;
}

.auth-register-brand-logo .brand-name span { color: var(--auth-blue); }

.auth-register-hero {
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.auth-register-hero img {
    width: 100%;
    max-width: 480px;
    height: auto;
    margin: 0 auto 24px;
    display: block;
}

.auth-register-tagline {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-panel-light-text);
    letter-spacing: -0.03em;
    line-height: 1.25;
    margin: 0 0 12px;
}

.auth-register-tagline .accent { color: var(--auth-blue); }

.auth-register-subtext {
    font-size: 15px;
    color: var(--auth-panel-light-muted);
    margin: 0;
    line-height: 1.5;
    max-width: 380px;
    margin-inline: auto;
}

.auth-register-form-panel {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 32px;
    background: var(--auth-bg);
    overflow-y: auto;
}

.auth-register-form-panel .auth-shell {
    max-width: 480px;
    padding: 0;
}

.auth-register-form-panel .auth-card {
    border: 1px solid var(--auth-border);
    box-shadow: none;
}

@media (max-width: 1023px) {
    .auth-register-brand { display: none; }
    .auth-register-form-panel { padding: 32px 24px; }
    .auth-register-mobile-brand { display: flex !important; margin-bottom: 24px; }
}

.auth-register-mobile-brand {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: block;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.auth-logo-mark-sm { width: 36px; height: 36px; border-radius: 10px; }

.auth-logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
    gap: 12px;
}

.auth-brand-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--auth-text);
    letter-spacing: -0.3px;
}

.auth-brand-name span { color: var(--auth-blue); }

.auth-headline { text-align: center; margin-bottom: 28px; }

.auth-headline h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--auth-text);
    letter-spacing: -0.4px;
    line-height: 1.3;
    margin: 0 0 6px;
}

.auth-headline p { font-size: 14px; color: var(--auth-muted); margin: 0; }
.auth-headline-left { text-align: left; }
.auth-headline-left h1 { font-size: 24px; }

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

.auth-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-label);
    margin-bottom: 6px;
}

.auth-input-wrap { position: relative; }

.auth-input-wrap .auth-field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: #64748b;
    stroke-width: 1.75;
    fill: none;
    pointer-events: none;
    transition: stroke 0.2s;
}

.auth-form-control {
    width: 100%;
    padding: 10px 14px 10px 38px;
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 14px;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.auth-form-control.no-icon { padding-left: 14px; }
.auth-form-control::placeholder { color: #64748b; }

.auth-form-control:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.auth-form-control[readonly],
.auth-form-control:disabled {
    background: color-mix(in srgb, var(--auth-muted) 18%, var(--auth-input-bg));
    color: var(--auth-text);
    opacity: 1;
    cursor: not-allowed;
}

.auth-form-control[readonly]:focus,
.auth-form-control:disabled:focus {
    border-color: var(--auth-border);
    box-shadow: none;
}

.field-locked--auth .auth-form-control {
    padding-right: 2.5rem;
}

.field-locked {
    position: relative;
    display: block;
}

.field-locked__icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 13px;
    pointer-events: none;
    line-height: 1;
    z-index: 1;
}

.field-locked--auth .field-locked__icon {
    right: 12px;
}

.auth-input-wrap:focus-within .auth-field-icon { stroke: var(--auth-blue); }
.auth-form-hint { font-size: 12px; color: var(--auth-muted); margin-top: 5px; }

.auth-toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: #64748b;
    transition: color 0.2s;
}

.auth-toggle-pw:hover { color: var(--auth-blue); }

.auth-toggle-pw svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.75;
    fill: none;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 8px;
    gap: 12px;
}

.auth-remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}

.auth-remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-blue);
    cursor: pointer;
}

.auth-forgot-link {
    font-size: 13px;
    color: var(--auth-blue);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.auth-forgot-link:hover { opacity: 0.85; }

.auth-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--auth-muted);
    line-height: 1.45;
    cursor: pointer;
    margin-bottom: 16px;
}

.auth-terms-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--auth-blue);
    flex-shrink: 0;
    cursor: pointer;
}

.auth-terms-label a {
    color: var(--auth-blue);
    text-decoration: none;
    font-weight: 500;
}

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

.auth-btn-primary {
    width: 100%;
    padding: 11px;
    background: linear-gradient(140deg, var(--auth-blue-light), var(--auth-blue-deep));
    color: white;
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.auth-btn-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    color: white;
}

.auth-btn-primary:active { transform: translateY(0); }

.auth-btn-outline {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-border);
    border-radius: 10px;
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--auth-text);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 8px;
}

.auth-btn-outline:hover {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(37, 99, 235, 0.06);
}

.auth-btn-outline .company-code {
    opacity: 0.55;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.auth-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--auth-muted);
    margin: 0 0 14px;
}

.auth-section-divider {
    border: none;
    border-top: 1px solid var(--auth-border);
    margin: 20px 0;
}

.auth-card-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
    text-align: center;
}

.auth-card-footer p { font-size: 13px; color: var(--auth-muted); margin: 0; }

.auth-card-footer a,
.auth-back-link {
    color: var(--auth-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-card-footer a:hover,
.auth-back-link:hover { opacity: 0.85; }

.auth-back-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
}

.auth-copyright {
    text-align: center;
    margin-top: 16px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.22);
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.03em;
}

.auth-alert-danger {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    margin-bottom: 16px;
}

.auth-alert-warning {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    margin-bottom: 16px;
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    color: #34d399;
    font-size: 14px;
}

.auth-text-danger { color: #f87171 !important; font-size: 12px; }

.auth-field .password-checklist {
    margin-top: 8px;
}

.auth-field .password-checklist-item {
    color: var(--auth-muted);
}

.auth-field .password-checklist-icon {
    color: var(--auth-muted);
    opacity: 0.4;
}

.auth-field .password-checklist-item.is-met,
.auth-field .password-checklist-item.is-met .password-checklist-icon {
    color: #34d399;
    opacity: 1;
}

.auth-mfa-input {
    font-family: 'DM Mono', monospace;
    font-size: 1.5rem;
    letter-spacing: 0.35em;
    text-align: center;
    padding: 12px 14px !important;
}

.auth-invite-banner {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-invite-banner strong { color: var(--auth-text); }

.auth-role-chip {
    display: inline-block;
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 6px;
}

/* ── Register wizard ── */

.auth-wizard-card {
    overflow: hidden;
}

.auth-wizard-progress {
    height: 4px;
    background: var(--auth-border);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 10px;
}

.auth-wizard-progress-fill {
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #60a5fa);
    background-size: 200% 100%;
    border-radius: 100px;
    transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    animation: authProgressShimmer 2.5s ease-in-out infinite;
}

.auth-wizard-progress-fill.is-step-2 {
    width: 100%;
}

@keyframes authProgressShimmer {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

.auth-wizard-step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--auth-muted);
    margin: 0 0 20px;
    letter-spacing: 0.02em;
    transition: opacity 0.3s ease;
}

.auth-wizard-panel {
    animation: authWizardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authWizardIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.auth-wizard-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.auth-btn-secondary {
    flex: 0 0 auto;
    padding: 11px 18px;
    background: transparent;
    color: var(--auth-muted);
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: 1.5px solid var(--auth-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.auth-btn-secondary:hover {
    border-color: rgba(148, 163, 184, 0.5);
    color: var(--auth-text);
    background: rgba(255, 255, 255, 0.03);
}

.auth-btn-primary-inline {
    flex: 1;
}

.auth-input-with-action {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.auth-input-with-action .auth-input-wrap {
    flex: 1;
}

.auth-btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    white-space: nowrap;
    background: rgba(37, 99, 235, 0.1);
    color: #93c5fd;
    font-family: 'Manrope', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.auth-btn-generate:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

.auth-btn-generate:active {
    transform: translateY(0);
}

.auth-code-generated {
    animation: authCodePulse 0.45s ease;
}

@keyframes authCodePulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70%  { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
    100% { box-shadow: none; }
}

/* TODO: REMOVE BEFORE RELEASE — dev-only login wipe control */
.auth-dev-only-form {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed rgba(239, 68, 68, 0.35);
    text-align: center;
}

.auth-dev-only-btn {
    display: inline-block;
    padding: 8px 12px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    border: 1px dashed rgba(239, 68, 68, 0.45);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.auth-dev-only-btn:hover {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.65);
}

.auth-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.auth-alert {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.auth-alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.auth-alert-info {
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.35);
    color: #93c5fd;
}
