/* ============================================================
   Onxeera — Premium Auth CSS v5.0
   Production Ready | No conflicts | Full responsive
   ============================================================ */

/* ── Google Font ── */
/* ── Scope: auth pages only ── */
.onxeera-auth body,
body.onxeera-auth {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Full-page wrapper ── */
.auth-root {
    min-height: 100vh;
    min-height: 100dvh; /* accounts for mobile browser toolbar so content isn't hidden behind it */
    display: flex;
    align-items: center;
    align-items: safe center; /* prevents the top of a tall form (e.g. Sign Up) from being clipped when the form is taller than the viewport */
    justify-content: center;
    background: linear-gradient(135deg, #F5E6DD 0%, #FBF4EF 40%, #F5E6DD 100%);
    padding: 40px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    isolation: isolate;
}
/* Ambient gradient glow — soft, blurred, decorative depth behind the card */
.auth-root::before,
.auth-root::after {
    content: '';
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}
.auth-root::before {
    width: 420px; height: 420px;
    top: -120px; left: -100px;
    background: radial-gradient(circle, rgba(156,68,37,.18), transparent 70%);
}
.auth-root::after {
    width: 460px; height: 460px;
    bottom: -140px; right: -110px;
    background: radial-gradient(circle, rgba(181,83,47,.16), transparent 70%);
}
@media (max-width: 600px) {
    .auth-root::before, .auth-root::after { width: 260px; height: 260px; filter: blur(40px); }
}

/* ── Card ── */
.auth-card {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    padding: 48px 48px 40px;
    box-shadow:
        0 0 0 1px rgba(181,83,47, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 12px 32px rgba(181,83,47, 0.08),
        0 32px 64px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    position: relative;
    animation: authCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo ── */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.auth-logo img {
    height: 40px;
    width: auto;
    display: block;
}

/* ── Heading ── */
.auth-heading {
    font-size: 28px;
    font-weight: 800;
    color: #141413;
    text-align: center;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 8px;
}

.auth-subheading {
    font-size: 15px;
    color: #262624;
    text-align: center;
    line-height: 1.6;
    margin: 0 0 28px;
}

/* ── Alert / message ── */
.auth-alert {
    display: none;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    padding: 13px 16px;
    margin-bottom: 18px;
    border-left: 4px solid;
}
.auth-alert.is-visible { display: block; }
.auth-alert.is-error   { background: #FBEDEA; border-color: #DC2626; color: #B91C1C; }
.auth-alert.is-success { background: #ECF4EE; border-color: #22C55E; color: #15803D; }
.auth-alert.is-info    { background: #FBF4EF; border-color: #B5532F; color: #9C4425; }

/* ── Google Button ── */
.auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    background: #ffffff;
    border: 1.5px solid #E6E3DA;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #262624;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 0;
}
.auth-google:hover {
    border-color: #B5532F;
    box-shadow: 0 0 0 3px rgba(181,83,47, 0.08), 0 2px 8px rgba(181,83,47, 0.10);
    color: #262624;
    transform: translateY(-1px);
}
.auth-google:active { transform: translateY(0); }
.auth-google:focus-visible {
    outline: 2px solid #B5532F;
    outline-offset: 2px;
}
.auth-google.is-soon {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── OR divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    font-size: 13px;
    font-weight: 500;
    color: #3D3D3A;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E6E3DA;
}

/* ── 2-col grid (first / last name row) ── */
.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Field ── */
.auth-field {
    margin-bottom: 16px;
}
.auth-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #262624;
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}
.auth-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-field-icon {
    position: absolute;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9C9A92;
    pointer-events: none;
    transition: color 0.15s;
    z-index: 1;
    width: 18px;
    height: 18px;
}
.auth-field:focus-within .auth-field-icon { color: #B5532F; }

.auth-field-input {
    width: 100%;
    height: 54px;
    padding: 0 54px 0 46px;
    background: #FFFFFF;
    border: 1.5px solid #E6E3DA;
    border-radius: 14px;
    font-size: 15px;
    color: #141413;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.auth-field-input:hover { border-color: #F5E6DD; }
.auth-field-input:focus {
    border-color: #B5532F;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(181,83,47, 0.10);
}
.auth-field-input::placeholder { color: #9C9A92; font-size: 14px; }
.auth-field-input.is-text { padding-right: 16px; }
.auth-field-input.is-error { border-color: #DC2626; }

.auth-field-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9C9A92;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
    z-index: 1;
}
.auth-field-toggle:hover { color: #B5532F; background: rgba(181,83,47, 0.06); }
.auth-field-toggle:focus-visible { outline: 2px solid #B5532F; }

/* ── Password strength ── */
.auth-strength {
    margin-top: 8px;
}
.auth-strength-track {
    height: 4px;
    background: #F5E6DD;
    border-radius: 4px;
    overflow: hidden;
}
.auth-strength-fill {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width 0.35s ease, background-color 0.35s ease;
}
.auth-strength-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
    min-height: 16px;
    transition: color 0.35s;
}

/* ── Checklist ── */
.auth-checks {
    list-style: none;
    padding: 10px 12px;
    margin: 10px 0 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    background: #FBF4EF;
    border-radius: 10px;
}
.auth-check-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: #3D3D3A;
    transition: color 0.2s;
    line-height: 1.3;
}
.auth-check-item#chk-match { grid-column: 1 / -1; }
.auth-check-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
}
.auth-check-item.is-valid { color: #2F8F5B; }

/* ── Remember / Forgot row ── */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 20px;
    gap: 8px;
}
.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #262624;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}
.auth-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #B5532F;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
}
.auth-forgot {
    font-size: 14px;
    color: #B5532F;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}
.auth-forgot:hover { color: #9C4425; text-decoration: underline; }

/* ── Terms ── */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 20px;
    font-size: 13px;
    color: #262624;
    line-height: 1.55;
}
.auth-terms input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: #B5532F;
    cursor: pointer;
}
.auth-terms a {
    color: #B5532F;
    font-weight: 600;
    text-decoration: none;
}
.auth-terms a:hover { text-decoration: underline; }

/* ── Primary button ── */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 54px;
    background: #B5532F;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    letter-spacing: 0.01em;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(181,83,47, 0.35);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.auth-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: none;
    border-radius: inherit;
}
.auth-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(181,83,47, 0.45);
}
.auth-btn:active { transform: translateY(0); opacity: 1; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-btn:focus-visible { outline: 2px solid #B5532F; outline-offset: 3px; }

.auth-btn-text { position: relative; z-index: 1; }
.auth-btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
    position: relative;
    z-index: 1;
}
.auth-btn.is-loading .auth-btn-spinner { display: block; }
.auth-btn.is-loading .auth-btn-text { opacity: 0.75; }

@keyframes authSpin { to { transform: rotate(360deg); } }

/* ── Switch link ── */
.auth-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: #262624;
}
.auth-switch a {
    color: #B5532F;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s;
}
.auth-switch a:hover { color: #9C4425; text-decoration: underline; }

/* ── Trust footer ── */
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #EFEDE7;
    flex-wrap: wrap;
}
.auth-footer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #3D3D3A;
    font-weight: 500;
}
.auth-footer-item svg { flex-shrink: 0; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .auth-root { padding: 24px 16px; align-items: flex-start; }
    .auth-card { padding: 32px 24px 28px; border-radius: 20px; margin: auto 0; }
    .auth-heading { font-size: 24px; }
    .auth-subheading { margin-bottom: 22px; }
    .auth-footer { gap: 16px; margin-top: 20px; padding-top: 16px; }
    .auth-field { margin-bottom: 14px; }
    .auth-field-input,
    .auth-google { height: 50px; }
    .auth-btn { height: 50px; }
}
@media (max-width: 380px) {
    .auth-root { padding: 16px 12px; }
    .auth-card { padding: 28px 18px 24px; border-radius: 18px; }
    .auth-heading { font-size: 22px; }
    .auth-footer { gap: 12px; }
    .auth-footer-item:last-child { display: none; }
    .auth-field-input,
    .auth-google { height: 48px; padding-left: 42px; }
    .auth-btn { height: 48px; }
    .auth-field-icon { left: 14px; }
}
@media (max-width: 330px) {
    .auth-root { padding: 12px 8px; }
    .auth-card { padding: 22px 14px 20px; border-radius: 14px; }
    .auth-heading { font-size: 20px; }
    .auth-sub { font-size: 13px; }
    .auth-grid-2 { gap: 10px; }
}

/* ── Focus visible ── */
*:focus { outline: none; }
*:focus-visible { outline: 2px solid #B5532F; outline-offset: 2px; border-radius: 4px; }

/* ── Touch devices — 44px minimum tap targets ────────────────── */
@media(hover:none) and (pointer:coarse){
    .auth-btn{min-height:48px}
    .auth-google{min-height:48px}
    .auth-field-input{min-height:46px}
    .auth-field-toggle{min-width:44px;min-height:44px}
    .auth-checkbox-label input[type="checkbox"]{width:18px;height:18px}
    /* Remove hover transforms on touch */
    .auth-btn:hover{transform:none}
    .auth-google:hover{transform:none;border-color:#E6E3DA;background:#fff}
}

/* ── 2-col grid: stack on mobile ─────────────────────────────── */
@media(max-width:480px){
    .auth-grid-2{grid-template-columns:1fr}
    .auth-checks{grid-template-columns:1fr}
    .auth-check-item#chk-match{grid-column:auto}
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media(prefers-reduced-motion:reduce){
    .auth-btn,.auth-google,.auth-field-input,.auth-card{transition:none}
    @keyframes authSpin{to{transform:rotate(0)}}
}

/* ============================================================
   Onxeera — Onboarding Additions v1.0
   (verify-email + about-you/goal/workspace/audit steps)
   Additive only — reuses existing .auth-* tokens above.
   ============================================================ */

.auth-card.is-wide { max-width: 720px; }

.onx-verify-icon {
    width: 64px; height: 64px; margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #F5E6DD; color: #B5532F;
}

.onx-btn-secondary {
    background: #fff; color: #B5532F; border: 1.5px solid #F5E6DD;
    box-shadow: none;
}
.onx-btn-secondary:hover { background: #FBF4EF; }

.onx-inline-form { margin-top: 14px; }

.auth-switch a#onx-change-email-link { cursor: pointer; }

/* ── Progress indicator ── */
.onx-progress { margin-bottom: 22px; }
.onx-progress-label {
    display: block; font-size: 13px; font-weight: 600; color: #B5532F; margin-bottom: 8px;
}
.onx-progress-track {
    width: 100%; height: 6px; border-radius: 999px; background: #E6E3DA; overflow: hidden;
}
.onx-progress-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #B5532F, #9C4425);
    transition: width .3s ease;
}

/* ── Selectable card grid (About You / Primary Goal) ── */
.onx-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}
@media (max-width: 600px) {
    .onx-card-grid { grid-template-columns: 1fr; }
}

.onx-select-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border: 1.5px solid #E6E3DA;
    border-radius: 14px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.onx-select-card:hover { border-color: #F5E6DD; background: #FBF4EF; }
.onx-select-card:active { transform: translateY(1px); }
.onx-select-card input[type="radio"] {
    position: absolute; top: 16px; right: 16px;
    width: 18px; height: 18px; accent-color: #B5532F;
}
.onx-select-card.is-selected {
    border-color: #B5532F;
    background: #F5E6DD;
    box-shadow: 0 0 0 3px rgba(181,83,47,.12);
}
.onx-select-card-title {
    font-size: 15px; font-weight: 600; color: #141413; padding-right: 26px;
}
.onx-select-card-desc {
    font-size: 13px; color: #262624; line-height: 1.4;
}
.onx-select-card input[type="radio"]:focus-visible { outline: 2px solid #B5532F; outline-offset: 2px; }

/* ── Workspace conditional field groups ── */
.onx-field-group { margin-top: 4px; }

/* ── Audit step ── */
.onx-audit-help {
    font-size: 13px; color: #262624; text-align: center; margin: 14px 0 0;
    line-height: 1.5;
}
.onx-audit-results {
    margin-top: 24px; padding-top: 20px; border-top: 1px solid #E6E3DA;
}
.onx-audit-score {
    display: flex; flex-direction: column; align-items: center; margin-bottom: 18px;
}
.onx-audit-score-num {
    font-size: 44px; font-weight: 800;
    background: linear-gradient(90deg, #B5532F, #9C4425);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    line-height: 1.1;
}
.onx-audit-score-label { font-size: 13px; color: #262624; font-weight: 600; letter-spacing: .02em; }
.onx-audit-recs {
    list-style: none; margin: 0 0 20px; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.onx-audit-recs li {
    font-size: 13.5px; color: #262624; line-height: 1.5;
    padding: 10px 14px; background: #F5F4EF; border-radius: 10px; border: 1px solid #EFEDE7;
}

/* ── Mobile tightening for wide onboarding card ── */
@media (max-width: 600px) {
    .auth-card.is-wide { padding: 32px 20px 28px; }
    .onx-select-card { padding: 14px 16px; }
    .onx-audit-score-num { font-size: 36px; }
}
