/* =============================================================================
   House of Tours — SSO Login Page
   Brand-aligned single sign-on entry for the Visa Ops AI platform.
   ============================================================================= */

:root {
    /* Brand tokens — must match admin_panel.css */
    --hot-teal:        #1c9dae;
    --hot-teal-deep:   #00858f;
    --hot-teal-hover:  #00a6b2;
    --hot-teal-soft:   #d6f0f3;
    --hot-teal-tint:   #effafb;
    --hot-teal-line:   #b3e0e6;

    --hot-yellow:      #fdc508;
    --hot-yellow-soft: #fff5cc;
    --hot-yellow-deep: #b07700;

    --ink:    #151d36;
    --ink-2:  #2b3554;
    --muted:  #6b7793;
    --line:   #e4e9f2;
    --line-2: #eef1f8;
    --bg:     #f6f8fc;
    --danger: #d8294a;
    --danger-bg: #fde8ec;
    --success: #1d9b5e;
    --success-bg: #e3f7ec;
    --warn:    #d18a14;
    --warn-bg: #fdf2dc;

    --r:       12px;
    --r-sm:    8px;
    --shadow:  0 6px 18px rgba(20, 30, 60, 0.08);
    --shadow-lg: 0 18px 48px rgba(20, 30, 60, 0.14);

    --font-display: "Figtree", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --font-body:    "Figtree", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
}
body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout: split screen ---------- */
.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- LEFT: brand panel ---------- */
.brand-panel {
    position: relative;
    color: #fff;
    padding: 56px 56px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background:
        radial-gradient(circle at 0% 100%, rgba(253, 197, 8, 0.18) 0%, transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.10) 0%, transparent 50%),
        linear-gradient(135deg, #0f4750 0%, #1c9dae 65%, #25b3c4 100%);
}

/* Soft decorative shapes */
.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}
.brand-panel::before {
    width: 360px;
    height: 360px;
    top: -120px;
    right: -120px;
    background: rgba(255, 255, 255, 0.10);
}
.brand-panel::after {
    width: 320px;
    height: 320px;
    bottom: -130px;
    left: -100px;
    background: rgba(253, 197, 8, 0.16);
}

.brand-top {
    position: relative;
    z-index: 2;
}
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.brand-logo .mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--hot-yellow);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 900;
}
.brand-logo .mark-text {
    font-size: 14.5px;
    color: #fff;
}

.brand-hero {
    position: relative;
    z-index: 2;
    margin-top: 80px;
}
.brand-hero h1 {
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 800;
    margin: 0 0 18px;
    max-width: 520px;
}
.brand-hero h1 .accent {
    color: var(--hot-yellow);
    background: linear-gradient(135deg, #ffd84a 0%, #fdc508 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-hero p {
    font-size: 16.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    max-width: 520px;
}

.brand-features {
    position: relative;
    z-index: 2;
    margin-top: 36px;
    display: grid;
    gap: 14px;
    max-width: 480px;
}
.brand-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    backdrop-filter: blur(6px);
}
.brand-feature .ic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(253, 197, 8, 0.18);
    color: var(--hot-yellow);
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
}
.brand-feature .tx {
    flex: 1;
    min-width: 0;
}
.brand-feature .ttl {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    margin-bottom: 2px;
}
.brand-feature .sub {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.45;
}

.brand-foot {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    padding-top: 24px;
}
.brand-foot a {
    color: rgba(255, 255, 255, 0.85);
}
.brand-foot a:hover { color: #fff; }
.brand-foot .dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    margin: 0 8px;
    vertical-align: middle;
}

/* ---------- RIGHT: form panel ---------- */
.form-panel {
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px;
    position: relative;
}
.form-panel .form-wrap {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.form-greeting {
    margin-bottom: 32px;
}
.form-greeting h2 {
    font-family: var(--font-display);
    font-size: 30px;
    letter-spacing: -0.02em;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--ink);
}
.form-greeting p {
    color: var(--muted);
    font-size: 14.5px;
    margin: 0;
}

/* Primary SSO button */
.btn-sso {
    width: 100%;
    border: 0;
    background: linear-gradient(135deg, var(--hot-teal) 0%, var(--hot-teal-deep) 100%);
    color: #fff;
    padding: 14px 18px;
    border-radius: var(--r);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.005em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 6px 16px rgba(28, 157, 174, 0.28);
    transition: transform 0.12s, box-shadow 0.18s, background 0.18s;
    margin-bottom: 22px;
}
.btn-sso:hover {
    background: linear-gradient(135deg, var(--hot-teal-hover) 0%, var(--hot-teal) 100%);
    box-shadow: 0 8px 22px rgba(28, 157, 174, 0.36);
    transform: translateY(-1px);
}
.btn-sso:active { transform: translateY(0); }
.btn-sso:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}
.btn-sso .sso-mark {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 900;
}
.btn-sso .arrow {
    margin-left: auto;
    font-size: 18px;
    transition: transform 0.18s;
}
.btn-sso:hover .arrow { transform: translateX(3px); }

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 18px 0 22px;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* Form fields */
.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}
.form-row label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}
.field {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    padding: 11px 14px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field::placeholder { color: #aab1c2; }
.field:hover { border-color: var(--hot-teal-line); }
.field:focus {
    outline: none;
    border-color: var(--hot-teal);
    box-shadow: 0 0 0 4px var(--hot-teal-tint);
}
.field.invalid {
    border-color: var(--danger);
    background: var(--danger-bg);
}
.field.invalid:focus {
    box-shadow: 0 0 0 4px rgba(216, 41, 74, 0.12);
}

.field-with-icon {
    position: relative;
}
.field-with-icon .field {
    padding-right: 46px;
}
.field-with-icon .icon-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 16px;
    transition: background 0.15s, color 0.15s;
}
.field-with-icon .icon-btn:hover {
    background: var(--bg);
    color: var(--ink);
}

/* Field hint / error message */
.field-msg {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.4;
}
.field-msg.error {
    color: var(--danger);
    font-weight: 600;
}

/* Inline form options row */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink-2);
    user-select: none;
}
.checkbox-row input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--line);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}
.checkbox-row input[type="checkbox"]:hover {
    border-color: var(--hot-teal);
}
.checkbox-row input[type="checkbox"]:checked {
    background: var(--hot-teal);
    border-color: var(--hot-teal);
}
.checkbox-row input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    inset: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: grid;
    place-items: center;
}
.link {
    color: var(--hot-teal-deep);
    font-size: 13px;
    font-weight: 600;
    transition: color 0.15s;
}
.link:hover { color: var(--hot-teal); text-decoration: underline; }

/* Primary submit — brand yellow CTA, matches the .btn-download on
   templates/index-new.html for visual fidelity across the product. */
.btn-primary {
    width: 100%;
    border: 0;
    background: var(--hot-yellow);
    color: var(--ink);
    padding: 13px 18px;
    border-radius: var(--r-sm);
    font-size: 14.5px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(253, 197, 8, 0.28);
    transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-primary:hover {
    background: #ffd633;
    box-shadow: 0 10px 22px rgba(253, 197, 8, 0.34);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(253, 197, 8, 0.24);
}
.btn-primary:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* Toggle between SSO-only / staff sign-in */
.staff-toggle {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line-2);
    color: var(--muted);
    font-size: 13px;
}
.staff-toggle a {
    color: var(--hot-teal-deep);
    font-weight: 700;
}
.staff-toggle a:hover {
    color: var(--hot-teal);
    text-decoration: underline;
}

/* Show/hide forms */
.form-mode { display: none; }
.form-mode.active { display: block; }

/* Top-level alert (shown on auth error) */
.alert {
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.45;
}

/* The HTML5 `hidden` attribute must always win over our display:flex above. */
.alert[hidden] {
    display: none !important;
}
.alert .ic { font-size: 16px; flex-shrink: 0; line-height: 1; padding-top: 1px; }
.alert.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f4c4cd;
}
.alert.info {
    background: var(--hot-teal-tint);
    color: var(--hot-teal-deep);
    border: 1px solid var(--hot-teal-line);
}
.alert.warn {
    background: var(--hot-yellow-soft);
    color: var(--hot-yellow-deep);
    border: 1px solid #fde79a;
}

/* Loading spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-primary .spinner {
    border-color: rgba(21, 29, 54, 0.25);
    border-top-color: var(--ink);
}
.btn-sso .spinner {
    border-color: rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
}

/* Small print at bottom */
.legal {
    text-align: center;
    margin-top: 28px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.6;
}
.legal a {
    color: var(--ink-2);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
}
.legal a:hover {
    color: var(--hot-teal-deep);
    text-decoration-color: currentColor;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
    }
    .brand-panel {
        padding: 44px 36px 36px;
        min-height: 320px;
    }
    .brand-hero { margin-top: 32px; }
    .brand-hero h1 { font-size: 32px; }
    .brand-features { display: none; }
    .brand-foot { padding-top: 18px; font-size: 11.5px; }
}

@media (max-width: 600px) {
    .form-panel {
        padding: 36px 24px;
    }
    .form-greeting h2 { font-size: 24px; }
    .brand-panel {
        padding: 32px 24px 28px;
        min-height: 240px;
    }
    .brand-hero h1 { font-size: 26px; }
    .brand-hero p { font-size: 14px; }
    .brand-foot { flex-direction: column; gap: 6px; align-items: flex-start; }
}

/* ---------- Local (email + password) login form ---------- */
.local-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 4px 0 18px;
}
.local-login-form .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.local-login-form .lbl {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.local-login-form input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--r);
    padding: 11px 13px;
    font-size: 14.5px;
    color: var(--ink);
    font: inherit;
    transition: border 0.15s, box-shadow 0.15s;
}
.local-login-form input:focus {
    outline: none;
    border-color: var(--hot-teal);
    box-shadow: 0 0 0 3px rgba(28, 157, 174, 0.18);
}

.login-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 10px;
    color: var(--muted);
    font-size: 12px;
}
.login-sep::before,
.login-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.signup-link {
    margin: 16px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
/* ``.linklike`` lets a <button> inside .signup-link render exactly like
   the existing <a> — used for the system-user "Sign in with email"
   entry point so a click runs the JS view-switch instead of navigating. */
.signup-link a,
.signup-link .linklike {
    color: var(--hot-teal-deep);
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}
.signup-link a:hover,
.signup-link .linklike:hover { text-decoration: underline; }
.signup-link .linklike:focus-visible {
    outline: none;
    text-decoration: underline;
    color: var(--hot-teal);
}

/* =============================================================================
   Method chooser (Odoo SSO / Local user) — same-page view switching
   ============================================================================= */

.auth-view { display: block; }
.auth-view[hidden] { display: none; }

.auth-view.is-entering {
    animation: viewFadeIn 0.22s ease-out both;
}
@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.method-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 4px 0 18px;
}

.method-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    background: #fff;
    text-align: left;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.18s, transform 0.12s, background 0.15s;
}
.method-card:hover {
    border-color: var(--hot-teal);
    box-shadow: 0 8px 22px rgba(28, 157, 174, 0.14);
    transform: translateY(-1px);
}
.method-card:active { transform: translateY(0); }
.method-card:focus-visible {
    outline: none;
    border-color: var(--hot-teal);
    box-shadow: 0 0 0 4px var(--hot-teal-tint);
}
.method-card:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.method-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 900;
    flex-shrink: 0;
}
.method-card--sso .method-icon {
    background: linear-gradient(135deg, var(--hot-teal) 0%, var(--hot-teal-deep) 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(28, 157, 174, 0.28);
}
.method-card--local .method-icon {
    background: linear-gradient(135deg, #ffd84a 0%, var(--hot-yellow) 100%);
    color: var(--ink);
    box-shadow: 0 6px 14px rgba(253, 197, 8, 0.28);
}

.method-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.method-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.005em;
}
.method-sub {
    font-size: 12.5px;
    color: var(--muted);
}

.method-arrow {
    font-size: 18px;
    color: var(--muted);
    transition: transform 0.18s, color 0.15s;
    flex-shrink: 0;
}
.method-card:hover .method-arrow {
    color: var(--hot-teal-deep);
    transform: translateX(3px);
}

/* Back-to-chooser link in the local form view */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    padding: 4px 0;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    transition: color 0.15s;
}
.back-link:hover { color: var(--hot-teal-deep); }
.back-link:focus-visible {
    outline: none;
    color: var(--hot-teal-deep);
    text-decoration: underline;
}
.back-link .arrow-left {
    transition: transform 0.15s;
    font-size: 16px;
}
.back-link:hover .arrow-left { transform: translateX(-3px); }

/* Small accent badge at the top of the signup form — echoes the
   yellow "Visa Ops User" method card on the sign-in chooser. */
.signup-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    background: var(--hot-yellow-soft);
    color: var(--hot-yellow-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 18px;
}
.signup-badge__icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd84a 0%, var(--hot-yellow) 100%);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 900;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}
