/* Openxerp SaaS auth page (/log-in) — self-contained, does not touch any core/theme CSS. */

:root {
    --oxsaas-accent: #4f46e5;
    --oxsaas-accent-dark: #3730a3;
    --oxsaas-ink: #0f172a;
    --oxsaas-muted: #64748b;
    --oxsaas-border: #e2e8f0;
    --oxsaas-bg: #ffffff;
    --oxsaas-danger: #dc2626;
    --oxsaas-success: #16a34a;
    --oxsaas-radius: 12px;
    --oxsaas-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

.oxsaas-body {
    margin: 0;
    font-family: var(--oxsaas-font);
    color: var(--oxsaas-ink);
    background: var(--oxsaas-bg);
}

.oxsaas-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ---------- Left visual panel ---------- */

.oxsaas-visual {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 45%, #4f46e5 100%);
    display: flex;
    align-items: flex-end;
    padding: 56px;
}

.oxsaas-visual-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: .8;
    transition: opacity .6s ease;
}

.oxsaas-visual-canvas--hidden {
    opacity: 0;
}

.oxsaas-visual-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .55;
}

.oxsaas-visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.15) 0%, rgba(15,23,42,.85) 100%);
}

.oxsaas-visual-content {
    position: relative;
    z-index: 1;
    color: #fff;
    max-width: 460px;
}

.oxsaas-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.oxsaas-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #fff;
    color: var(--oxsaas-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.oxsaas-brand-name {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .2px;
}

.oxsaas-visual-content h1 {
    font-size: 34px;
    line-height: 1.25;
    font-weight: 800;
    margin: 0 0 14px;
}

.oxsaas-visual-content p {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255,255,255,.85);
    margin: 0 0 22px;
}

.oxsaas-visual-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    color: rgba(255,255,255,.92);
}

.oxsaas-visual-points li {
    padding-inline-start: 24px;
    position: relative;
}

.oxsaas-visual-points li::before {
    content: "✓";
    position: absolute;
    inset-inline-start: 0;
    color: #a5b4fc;
    font-weight: 700;
}

/* ---------- Right auth panel ---------- */

.oxsaas-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.oxsaas-panel-inner {
    width: 100%;
    max-width: 380px;
}

.oxsaas-panel-head h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px;
}

.oxsaas-muted {
    color: var(--oxsaas-muted);
    font-size: 14px;
    margin: 0 0 28px;
}

.oxsaas-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.oxsaas-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--oxsaas-ink);
}

.oxsaas-field input {
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    padding: 11px 14px;
    border: 1px solid var(--oxsaas-border);
    border-radius: 9px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    width: 100%;
}

.oxsaas-field input:focus {
    border-color: var(--oxsaas-accent);
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.oxsaas-hint {
    font-weight: 400;
    color: var(--oxsaas-muted);
    font-size: 12px;
}

.oxsaas-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.oxsaas-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    color: var(--oxsaas-muted);
    cursor: pointer;
}

.oxsaas-link {
    color: var(--oxsaas-accent);
    text-decoration: none;
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.oxsaas-link:hover { text-decoration: underline; }

.oxsaas-link-strong { font-weight: 700; }

.oxsaas-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .05s ease, opacity .15s ease;
}

.oxsaas-btn:active { transform: scale(.99); }

.oxsaas-btn-primary {
    background: var(--oxsaas-accent);
    color: #fff;
}

.oxsaas-btn-primary:hover { background: var(--oxsaas-accent-dark); }

.oxsaas-btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.oxsaas-btn-google {
    background: #fff;
    color: var(--oxsaas-ink);
    border-color: var(--oxsaas-border);
}

.oxsaas-btn-google:hover { background: #f8fafc; }

.oxsaas-btn-google-lg {
    padding: 14px 16px;
    font-size: 15px;
}

.oxsaas-center-note {
    text-align: center;
    margin: 16px 0 0;
}

.oxsaas-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--oxsaas-muted);
    font-size: 12px;
    margin: 20px 0;
}

.oxsaas-divider::before,
.oxsaas-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--oxsaas-border);
}

.oxsaas-switch {
    text-align: center;
    font-size: 13px;
    color: var(--oxsaas-muted);
    margin-top: 26px;
}

.oxsaas-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--oxsaas-danger);
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 9px;
    margin-bottom: 16px;
}

.oxsaas-alert.oxsaas-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: var(--oxsaas-success);
}

.oxsaas-verified-email {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 9px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.oxsaas-verified-email strong { font-weight: 700; }

/* ---------- Modal ---------- */

.oxsaas-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* CRITICAL: without this, the modal is ALWAYS visually visible regardless
   of the hidden attribute or el.hidden = true/false in JS. The rule above
   sets display:flex as author CSS, which overrides the browser's built-in
   [hidden] { display: none } user-agent stylesheet rule entirely - author
   CSS always wins over UA stylesheet rules, independent of specificity.
   This explicit, higher-specificity override restores the correct
   behavior. Verified with real headless Chrome rendering, not just
   checking for the attribute in the HTML source. */
.oxsaas-modal[hidden] {
    display: none;
}

.oxsaas-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(2px);
}

.oxsaas-modal-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(15,23,42,.25);
    max-height: 90vh;
    overflow-y: auto;
}

.oxsaas-modal-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--oxsaas-muted);
    cursor: pointer;
}

.oxsaas-modal-card h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px;
}

/* ---------- Progress step ---------- */

.oxsaas-progress-step {
    text-align: center;
    padding: 12px 0 4px;
}

.oxsaas-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--oxsaas-border);
    border-top-color: var(--oxsaas-accent);
    margin: 0 auto 20px;
    animation: oxsaas-spin 0.8s linear infinite;
}

@keyframes oxsaas-spin {
    to { transform: rotate(360deg); }
}

.oxsaas-progress-step h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
}

.oxsaas-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--oxsaas-border);
    overflow: hidden;
    margin-top: 20px;
}

.oxsaas-progress-bar-fill {
    height: 100%;
    width: 8%;
    background: var(--oxsaas-accent);
    border-radius: 999px;
    transition: width .4s ease;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .oxsaas-shell { grid-template-columns: 1fr; }
    .oxsaas-visual { display: none; }
    .oxsaas-panel { padding: 32px 20px; }
}
