/* Sign-in, sign-up and onboarding pages (templates/auth/*). */
:root {
    --wp-primary: #3F5A73;
    --wp-primary-hover: #2F465B;
    --wp-primary-soft: #E6EDF3;
    --wp-ink: #111827;
    --wp-text: #374151;
    --wp-muted: #6B7280;
    --wp-border: #E5E7EB;
    --wp-bg: #F8FAFC;
    --wp-danger: #B91C1C;
    --wp-danger-bg: #FEF2F2;
    --wp-success: #047857;
    --wp-success-bg: #ECFDF5;
    --wp-brand-from: #0B1626;
    --wp-brand-to: #3F5A73;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
.auth-body {
    margin: 0;
    font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--wp-text);
    background: var(--wp-bg);
}
.auth-shell { display: flex; min-height: 100vh; }

/* ---------- brand side ---------- */
.auth-brand {
    position: relative;
    flex: 0 0 44%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    padding: 40px 48px;
    color: #E2E8F0;
    background: radial-gradient(120% 90% at 0% 0%, #1E3A5F 0%, transparent 60%),
                linear-gradient(160deg, var(--wp-brand-from) 0%, var(--wp-brand-to) 100%);
    overflow: hidden;
}
.auth-brand-logo {
    display: inline-flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 600; font-size: 20px; text-decoration: none;
}
.auth-brand-logo img { height: 34px; width: 34px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.auth-brand-copy { margin-top: auto; margin-bottom: 32px; position: relative; z-index: 1; }
.auth-brand-copy h1 { color: #fff; font-size: 34px; line-height: 1.2; font-weight: 600; max-width: 440px; }
.auth-brand-copy p { font-size: 17px; line-height: 1.6; color: #CBD5E1; max-width: 440px; margin: 16px 0 28px; }
.auth-brand-list { list-style: none; padding: 0; margin: 0; }
.auth-brand-list li { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 16px; color: #F1F5F9; }
.auth-brand-list i {
    width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .12); color: #fff; font-size: 15px;
}
.auth-brand-art { position: absolute; right: -40px; top: 90px; width: 520px; color: #7DD3FC; opacity: .9; }
.auth-brand-bus { animation: wp-pulse 2.4s ease-in-out infinite; transform-origin: 220px 150px; }
@keyframes wp-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.auth-brand-foot { font-size: 13px; color: #94A3B8; margin: 0; }

/* ---------- form side ---------- */
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 24px 20px 48px; }
.auth-topbar { width: 100%; max-width: 440px; display: flex; justify-content: flex-end; align-items: center; margin-bottom: 6vh; }
/* Wide pages (company wizard): align the top bar with the card and start higher */
.auth-main:has(.auth-card.wide) .auth-topbar { max-width: 560px; margin-bottom: 2vh; }
.auth-mobile-logo { display: none; align-items: center; gap: 8px; font-weight: 600; color: var(--wp-ink); text-decoration: none; margin-right: auto; }
.auth-mobile-logo img { height: 28px; width: 28px; }
.auth-lang { position: relative; }
.auth-lang-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
    border: 1px solid var(--wp-border); border-radius: 999px; background: #fff; color: var(--wp-text);
    font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.auth-lang-btn:hover { background: #F9FAFB; }
.auth-lang-caret { font-size: 10px; color: var(--wp-muted); }
.auth-lang-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 180px; max-height: 320px; overflow-y: auto;
    list-style: none; margin: 0; padding: 6px; background: #fff; border: 1px solid var(--wp-border); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, .12);
}
.auth-lang-menu button {
    width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--wp-text);
    padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left;
}
.auth-lang-menu button:hover { background: #F3F4F6; }
.auth-lang-menu li[aria-selected="true"] button { color: var(--wp-primary); font-weight: 500; }

.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 28px; font-weight: 600; color: var(--wp-ink); margin: 0 0 6px; }
.auth-sub { color: var(--wp-muted); font-size: 15px; margin: 0 0 28px; }

.auth-btn-google {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 46px; border: 1px solid #D1D5DB; border-radius: 10px; background: #fff;
    font: inherit; font-weight: 500; font-size: 15px; color: var(--wp-ink); cursor: pointer;
    transition: background .15s, box-shadow .15s;
}
.auth-btn-google:hover { background: #F9FAFB; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.auth-btn-google svg { width: 18px; height: 18px; }

.auth-divider { display: flex; align-items: center; gap: 12px; color: #9CA3AF; font-size: 13px; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--wp-border); }

.auth-field { margin-bottom: 16px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .auth-row { grid-template-columns: 1fr; } }
.auth-field label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; color: var(--wp-ink); margin-bottom: 6px; }
.auth-field label .auth-optional { font-weight: 400; color: #9CA3AF; }
.auth-input, .auth-select {
    width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: 15px; color: var(--wp-ink);
    border: 1px solid #D1D5DB; border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.auth-input:focus, .auth-select:focus { outline: none; border-color: var(--wp-primary); box-shadow: 0 0 0 3px rgba(63, 90, 115, .2); }
.auth-input[aria-invalid="true"] { border-color: #F87171; }
.auth-hint { font-size: 13px; color: #9CA3AF; margin-top: 6px; }
.auth-link { color: var(--wp-primary); font-weight: 500; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.auth-link:hover { color: var(--wp-primary-hover); text-decoration: underline; }
.auth-row-end { display: flex; justify-content: flex-end; margin: -6px 0 18px; font-size: 14px; }

.auth-btn-primary {
    width: 100%; height: 46px; border: 0; border-radius: 10px; background: var(--wp-primary); color: #fff;
    font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; transition: background .15s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn-primary:hover { background: var(--wp-primary-hover); }
.auth-btn-primary:disabled, .auth-btn-google:disabled { opacity: .6; cursor: default; }
.auth-btn-secondary {
    height: 46px; padding: 0 18px; border: 1px solid #D1D5DB; border-radius: 10px; background: #fff; color: var(--wp-ink);
    font: inherit; font-weight: 500; font-size: 15px; cursor: pointer;
}
.auth-btn-secondary:hover { background: #F9FAFB; }
.auth-spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: wp-spin .7s linear infinite; }
@keyframes wp-spin { to { transform: rotate(360deg); } }

.auth-alert { display: none; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; }
.auth-alert.show { display: flex; }
.auth-alert.error { background: var(--wp-danger-bg); color: var(--wp-danger); border: 1px solid #FECACA; }
.auth-alert.success { background: var(--wp-success-bg); color: var(--wp-success); border: 1px solid #A7F3D0; }

.auth-terms { font-size: 13px; color: var(--wp-muted); margin: 16px 0 0; line-height: 1.5; }
.auth-terms a { color: var(--wp-text); }
.auth-switch { text-align: center; font-size: 14px; color: var(--wp-muted); margin-top: 28px; }

/* password show/hide (static/js/framework/password-toggle.js) */
.pw-toggle-wrap { position: relative; display: block; }
.pw-toggle-wrap > input { padding-right: 2.75rem; }
.pw-toggle-btn {
    position: absolute; top: 50%; right: .5rem; transform: translateY(-50%);
    border: 0; background: transparent; color: #9CA3AF; padding: .25rem .4rem; line-height: 1; cursor: pointer;
}
.pw-toggle-btn:hover, .pw-toggle-btn:focus-visible { color: #4B5563; }

/* verify page */
.auth-icon-circle {
    width: 56px; height: 56px; border-radius: 50%; background: var(--wp-primary-soft); color: var(--wp-primary);
    display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 20px;
}
.auth-email-chip { display: inline-block; padding: 4px 10px; border-radius: 8px; background: #F3F4F6; color: var(--wp-ink); font-weight: 500; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

/* onboarding */
.auth-card.wide { max-width: 560px; }
.auth-steps { display: flex; gap: 8px; margin-bottom: 24px; }
.auth-step { flex: 1; font-size: 13px; color: #9CA3AF; }
.auth-step::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--wp-border); margin-bottom: 8px; }
.auth-step.active, .auth-step.done { color: var(--wp-primary); font-weight: 500; }
.auth-step.active::before, .auth-step.done::before { background: var(--wp-primary); }
.auth-map { height: 320px; border-radius: 12px; border: 1px solid var(--wp-border); overflow: hidden; margin-bottom: 12px; }
.auth-map-tools { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--wp-muted); margin-bottom: 20px; gap: 12px; }
.auth-btn-row { display: flex; gap: 12px; }
.auth-btn-row .auth-btn-primary { flex: 1; }
.auth-account-line { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--wp-muted); margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--wp-border); }

@media (max-width: 991.98px) {
    .auth-brand { display: none; }
    .auth-mobile-logo { display: inline-flex; }
    .auth-topbar { margin-bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-brand-bus, .auth-spinner { animation: none; }
}

/* Company access level (onboarding) */
.auth-access { border: 0; padding: 0; margin: 4px 0 20px; min-width: 0; }
.auth-access legend { font-size: 14px; font-weight: 600; color: var(--wp-ink); margin-bottom: 8px; }
.auth-access-options { display: grid; grid-template-columns: 1fr; gap: 10px; }
.auth-field .auth-access-option { margin: 0; justify-content: flex-start; font-weight: 400; }
.auth-access-option { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 12px; border: 1.5px solid var(--wp-border); border-radius: 12px; background: #fff; cursor: pointer; font-size: 13px; line-height: 1.45; color: var(--wp-text); }
.auth-access-option:hover { border-color: #9DB0C2; }
.auth-access-option input { position: absolute; top: 14px; right: 12px; width: 16px; height: 16px; accent-color: var(--wp-primary); margin: 0; }
.auth-access-option:has(input:checked) { border-color: var(--wp-primary); background: var(--wp-primary-soft); box-shadow: 0 0 0 3px rgba(63, 90, 115, .15); }
.auth-access-option:has(input:focus-visible) { outline: 2px solid var(--wp-primary); outline-offset: 2px; }
.auth-access-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--wp-ink); padding-right: 22px; }
.auth-access-name i { color: var(--wp-primary); }
.auth-access-examples { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--wp-border); color: var(--wp-muted); font-size: 12.5px; }
.auth-access-warning { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; font-size: 13.5px; line-height: 1.5; }
.auth-access-warning i { margin-top: 3px; }
.auth-field .auth-check { justify-content: flex-start; margin-bottom: 0; }
.auth-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 500; color: var(--wp-ink); cursor: pointer; }
.auth-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--wp-primary); flex: none; }
.auth-access-summary { margin: 14px 0 4px; padding: 12px 14px; border-radius: 10px; background: var(--wp-primary-soft); font-size: 14px; color: var(--wp-ink); }
.auth-access-summary p { margin: 4px 0 0; color: var(--wp-text); font-size: 13.5px; }
