/* ============================================================
   SpectraKit Prism — Authentication (login.php, register.php)
   Split layout: brand showcase + form panel. RTL-safe (logical
   properties), responsive from 320px phones to wide desktops.
   ============================================================ */

:root {
    --accent: #00ff88;
    --accent-strong: #00d672;
    --accent-soft: rgba(0, 255, 136, 0.12);
    --accent-ring: rgba(0, 255, 136, 0.28);
    --cyan: #00d4ff;
    --bg: #07090a;
    --bg-panel: #0b0e10;
    --surface: #101417;
    --surface-2: #151a1e;
    --field: #0d1113;
    --line: #1f2629;
    --line-strong: #2b3438;
    --text: #f4f7f6;
    --text-2: #a9b3b0;
    --text-3: #6f7a77;
    --danger: #ff5c6c;
    --danger-soft: rgba(255, 92, 108, 0.1);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    /* kept for inline styles that already reference them */
    --text-light: var(--text);
    --text-gray: var(--text-2);
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body.auth-body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Shell ─────────────────────────────────────────────────── */
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-shell.is-wide {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

/* ── Brand / showcase panel ───────────────────────────────── */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.25rem;
    padding: 2.5rem clamp(2rem, 4vw, 4rem);
    overflow: hidden;
    border-inline-end: 1px solid var(--line);
    background:
        radial-gradient(900px 520px at 0% 0%, rgba(0, 255, 136, 0.13), transparent 60%),
        radial-gradient(700px 480px at 100% 100%, rgba(0, 212, 255, 0.1), transparent 60%),
        var(--bg-panel);
    isolation: isolate;
}

/* faint grid */
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 30% 30%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 30%, #000 30%, transparent 75%);
}

.shell-sticky .auth-brand {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
}

.auth-brand > .brand-logo {
    margin-bottom: auto;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.brand-logo:hover {
    color: var(--text);
    text-decoration: none;
}

.brand-logo img {
    width: 40px;
    height: 40px;
    padding: 0.2rem;
    border-radius: 11px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 255, 136, 0.18);
    filter: brightness(0) invert(1);
}

.brand-logo small {
    display: block;
    color: var(--text-3);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.brand-copy {
    max-width: 540px;
}

.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(0, 255, 136, 0.25);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
}

.brand-eyebrow .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.18);
    animation: auth-pulse 2.4s ease-in-out infinite;
}

.brand-title {
    margin: 1.1rem 0 0.75rem;
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-title .accent {
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-sub {
    margin: 0;
    max-width: 470px;
    color: var(--text-2);
    font-size: 1rem;
}

/* product preview (decorative) */
.brand-preview {
    position: relative;
    max-width: 560px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(21, 26, 30, 0.92), rgba(13, 17, 19, 0.92));
    box-shadow: var(--shadow), 0 0 0 1px rgba(0, 255, 136, 0.04);
    backdrop-filter: blur(6px);
}

.preview-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.preview-bar i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2a3236;
}

.preview-bar span {
    margin-inline-start: auto;
    color: var(--text-3);
    font-size: 0.72rem;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.preview-stat {
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.preview-stat small {
    display: block;
    color: var(--text-3);
    font-size: 0.7rem;
}

.preview-stat strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.preview-stat em {
    color: var(--accent);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 600;
}

.preview-body {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.preview-chart,
.preview-list {
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.preview-chart small,
.preview-list small {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text-3);
    font-size: 0.7rem;
}

.preview-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 78px;
}

.preview-bars span {
    flex: 1;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, var(--accent), rgba(0, 255, 136, 0.25));
    transform-origin: bottom;
    animation: auth-grow 1s cubic-bezier(.2, .8, .2, 1) both;
}

.preview-bars span:nth-child(2n) {
    background: linear-gradient(180deg, var(--cyan), rgba(0, 212, 255, 0.2));
}

.preview-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.32rem 0;
    font-size: 0.75rem;
    color: var(--text-2);
}

.preview-row .av {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 700;
}

.preview-row .track {
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: #1d2427;
    overflow: hidden;
}

.preview-row .track b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.brand-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.5rem;
    max-width: 560px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.brand-features li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.brand-features .ic {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.85rem;
}

.brand-features strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
}

.brand-features span {
    display: block;
    color: var(--text-3);
    font-size: 0.78rem;
}

.brand-steps {
    display: grid;
    gap: 1rem;
    max-width: 440px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.brand-steps li {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.brand-steps .num {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-radius: 50%;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
}

.brand-steps strong {
    display: block;
    font-size: 0.92rem;
}

.brand-steps span {
    color: var(--text-3);
    font-size: 0.82rem;
}

.brand-foot {
    margin-top: auto;
    padding-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    color: var(--text-3);
    font-size: 0.78rem;
}

.brand-foot i {
    color: var(--accent);
    margin-inline-end: 0.35rem;
}

/* ── Form panel ───────────────────────────────────────────── */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem);
    background: var(--bg);
}

.auth-panel.align-top {
    align-items: flex-start;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

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

.auth-mobile-brand {
    display: none;
    margin-bottom: 1.75rem;
}

.auth-head h1,
.auth-head h2 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.55rem, 2.4vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-head p {
    margin: 0 0 1.75rem;
    color: var(--text-2);
}

/* fields */
.field {
    margin-bottom: 1rem;
}

.field-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    color: var(--text-2);
    font-size: 0.82rem;
    font-weight: 600;
}

.field-label .hint {
    color: var(--text-3);
    font-weight: 500;
}

.input-group-modern {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group-modern > i:first-child {
    position: absolute;
    inset-inline-start: 0.95rem;
    color: var(--text-3);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-group-modern .form-control,
.auth-body .form-control {
    width: 100%;
    height: 48px;
    padding: 0 0.95rem;
    padding-inline-start: 2.65rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--field);
    color: var(--text);
    font-size: 0.95rem;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input-group-modern .form-control.has-toggle {
    padding-inline-end: 2.9rem;
}

.auth-body select.form-control {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236f7a77' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.95rem center;
    padding-inline-end: 2.4rem;
}

[dir="rtl"] .auth-body select.form-control,
.auth-body[dir="rtl"] select.form-control {
    background-position: left 0.95rem center;
}

.auth-body select.form-control option {
    background: var(--surface);
    color: var(--text);
}

.auth-body .form-control::placeholder {
    color: #4f5a57;
}

.auth-body .form-control:hover {
    border-color: var(--line-strong);
}

.auth-body .form-control:focus {
    outline: none;
    border-color: rgba(0, 255, 136, 0.55);
    background: #0f1416;
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
    color: var(--text);
}

.input-group-modern.is-active > i:first-child,
.input-group-modern:focus-within > i:first-child {
    color: var(--accent);
}

.auth-body .form-control[readonly] {
    opacity: 0.75;
    cursor: not-allowed;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 0.4rem;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

/* password strength (register) */
.strength {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.strength-bars {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.strength-bars span {
    height: 4px;
    border-radius: 999px;
    background: var(--line);
    transition: background-color 0.25s ease;
}

.strength-text {
    min-width: 64px;
    color: var(--text-3);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: end;
}

.strength[data-level="1"] .strength-bars span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] .strength-bars span:nth-child(-n+2) { background: #ffb020; }
.strength[data-level="3"] .strength-bars span:nth-child(-n+3) { background: #7ee36f; }
.strength[data-level="4"] .strength-bars span:nth-child(-n+4) { background: var(--accent); }

/* buttons */
.btn-primary-auth,
.btn-login,
.btn-register {
    width: 100%;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #04140c;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 255, 136, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary-auth:hover,
.btn-login:hover,
.btn-register:hover {
    color: #04140c;
    text-decoration: none;
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 14px 34px rgba(0, 255, 136, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-login:disabled,
.btn-register:disabled {
    cursor: not-allowed;
    filter: grayscale(0.4);
    transform: none;
    opacity: 0.7;
}

[dir="rtl"] .btn-login .fa-arrow-right,
[dir="rtl"] .btn-register .fa-arrow-right {
    transform: scaleX(-1);
}

.btn-google,
.btn-secondary-auth {
    width: 100%;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.93rem;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-google:hover,
.btn-secondary-auth:hover {
    color: var(--text);
    text-decoration: none;
    background: var(--surface-2);
    border-color: #3a4549;
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.4rem 0;
    color: var(--text-3);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-switch {
    margin: 1.6rem 0 0;
    color: var(--text-2);
    font-size: 0.9rem;
    text-align: center;
}

.auth-switch a {
    font-weight: 600;
}

.auth-legal {
    margin-top: 1.25rem;
    color: var(--text-3);
    font-size: 0.75rem;
    text-align: center;
}

.auth-legal i {
    color: var(--accent);
    margin-inline-end: 0.3rem;
}

/* alerts */
.auth-alert,
.auth-body .alert.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 92, 108, 0.3);
    border-radius: 12px;
    background: var(--danger-soft);
    color: #ffd2d7;
    font-size: 0.88rem;
}

.auth-alert > i {
    margin-top: 0.15rem;
    color: var(--danger);
}

.auth-alert.is-info {
    border-color: rgba(0, 255, 136, 0.25);
    background: var(--accent-soft);
    color: #c9ffe5;
}

.auth-alert.is-info > i {
    color: var(--accent);
}

.auth-alert strong {
    display: block;
    color: #fff;
}

.auth-alert a {
    color: inherit;
    text-decoration: underline;
}

/* success overlay + subscription modal reuse this */
.logo-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    box-shadow: 0 16px 40px rgba(0, 255, 136, 0.3);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

/* ── Register: steps & sections ───────────────────────────── */
.form-section {
    padding: 1.4rem;
    margin-bottom: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(16, 20, 23, 0.9), rgba(11, 14, 16, 0.9));
}

.section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.section-head .step {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
}

.section-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.section-head p {
    margin: 0;
    color: var(--text-3);
    font-size: 0.8rem;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

.field-grid .span-2 {
    grid-column: 1 / -1;
}

.google-identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(0, 255, 136, 0.25);
    border-radius: 14px;
    background: var(--accent-soft);
}

.google-identity img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.google-identity strong {
    display: block;
    font-size: 0.92rem;
}

.google-identity span {
    color: var(--text-2);
    font-size: 0.82rem;
}

.state-card {
    padding: 2rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    text-align: center;
}

.state-card .state-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: 0 auto 1rem;
    border-radius: 50%;
    font-size: 1.6rem;
}

.state-card.is-danger .state-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.state-card.is-success .state-icon {
    background: var(--accent-soft);
    color: var(--accent);
}

.state-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.state-card p {
    margin: 0 auto 1.25rem;
    max-width: 380px;
    color: var(--text-2);
}

.state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.state-actions > a {
    width: auto;
    min-width: 170px;
    padding: 0 1.25rem;
}

/* billing toggle */
.plans-container {
    position: relative;
}

.billing-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--field);
}

.billing-label {
    color: var(--text-3);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.billing-label.active {
    color: var(--text);
}

.save-badge {
    margin-inline-start: 0.35rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
    margin: 0;
    flex-shrink: 0;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #222a2e;
    transition: background-color 0.2s ease;
}

.slider::before {
    content: '';
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.switch input:checked + .slider {
    background: var(--accent);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

[dir="rtl"] .switch input:checked + .slider::before {
    transform: translateX(-20px);
}

.switch input:focus-visible + .slider {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* plan cards */
.plans-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.85rem;
}

.scroll-btn {
    display: none !important;
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--field);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.plan-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.plan-card.selected {
    border-color: rgba(0, 255, 136, 0.65);
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.07), rgba(13, 17, 19, 0.95) 60%);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1), 0 16px 34px rgba(0, 0, 0, 0.35);
}

.plan-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plan-card:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.plan-popular,
.discount-badge {
    position: absolute;
    top: -10px;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.plan-popular {
    inset-inline-start: 1rem;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    color: #04140c;
}

.discount-badge {
    inset-inline-end: 1rem;
    background: #ff5c6c;
    color: #fff;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.plan-name {
    color: var(--text-2);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.plan-price {
    margin-top: 0.2rem;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.plan-duration {
    color: var(--text-3);
    font-size: 0.78rem;
}

.custom-radio {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.plan-card.selected .custom-radio {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 4px var(--field), inset 0 0 0 10px var(--accent);
}

.plan-trial {
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.plan-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.plan-stats div {
    padding: 0.45rem 0.3rem;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.plan-stats small {
    display: block;
    color: var(--text-3);
    font-size: 0.66rem;
}

.plan-stats b {
    display: block;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.feature-list {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    display: flex;
    gap: 0.5rem;
    color: var(--text-2);
    font-size: 0.8rem;
}

.feature-list i {
    margin-top: 0.22rem;
    color: var(--accent);
    font-size: 0.7rem;
}

.submit-row {
    margin-top: 1.4rem;
}

/* ── Motion ───────────────────────────────────────────────── */
@keyframes auth-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.18); }
    50% { box-shadow: 0 0 0 7px rgba(0, 255, 136, 0.05); }
}

@keyframes auth-grow {
    from { transform: scaleY(0.1); opacity: 0.4; }
    to { transform: scaleY(1); opacity: 1; }
}

@keyframes auth-rise {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.auth-card {
    animation: auth-rise 0.5s cubic-bezier(.2, .8, .2, 1) both;
}

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

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1199.98px) {
    .auth-shell.is-wide {
        grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    }

    .shell-sticky .brand-preview {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .auth-shell,
    .auth-shell.is-wide {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    .auth-panel,
    .auth-panel.align-top {
        align-items: center;
        padding: 1.75rem 1.25rem 2.5rem;
        background:
            radial-gradient(600px 300px at 50% -80px, rgba(0, 255, 136, 0.12), transparent 70%),
            var(--bg);
    }

    .auth-mobile-brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .auth-panel.align-top {
        align-items: flex-start;
    }

    .auth-card {
        margin-top: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    body.auth-body {
        font-size: 14.5px;
    }

    .auth-panel,
    .auth-panel.align-top {
        align-items: flex-start;
        padding: 1.25rem 1rem 2rem;
    }

    .form-section {
        padding: 1.1rem;
        border-radius: 16px;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .plans-carousel {
        grid-template-columns: 1fr;
    }

    .billing-toggle-container {
        display: flex;
        justify-content: center;
    }

    .state-actions > a {
        width: 100%;
    }
}

@media (max-height: 760px) and (min-width: 992px) {
    .auth-brand {
        gap: 1.5rem;
        padding-block: 1.75rem;
    }

    .preview-body {
        display: none;
    }
}

/* ── Large screens: centred, framed workspace (space goes to the outer edges) ── */
@media (min-width: 1400px) {
    body.auth-body {
        --frame-pad: clamp(24px, 2.6vw, 48px);
        display: flex;
        align-items: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: var(--frame-pad);
        background:
            radial-gradient(1100px 650px at 8% -10%, rgba(0, 255, 136, 0.08), transparent 60%),
            radial-gradient(900px 600px at 105% 110%, rgba(0, 212, 255, 0.07), transparent 60%),
            #040506;
    }

    .auth-shell,
    .auth-shell.is-wide {
        width: 100%;
        max-width: 1440px;
        margin: 0 auto;
        min-height: min(920px, calc(100dvh - 2 * var(--frame-pad)));
        border: 1px solid var(--line);
        border-radius: 28px;
        background: var(--bg-panel);
        box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02);
    }

    .auth-brand {
        border-start-start-radius: 28px;
        border-end-start-radius: 28px;
    }

    .auth-panel {
        border-start-end-radius: 28px;
        border-end-end-radius: 28px;
    }

    .auth-card {
        max-width: 440px;
    }

    /* register: the onboarding panel stays in view inside the frame */
    .shell-sticky .auth-brand {
        top: var(--frame-pad);
        height: calc(100dvh - 2 * var(--frame-pad));
        max-height: 920px;
        border-end-start-radius: 0;
    }

    .shell-sticky .auth-panel {
        padding-block: 3rem;
    }
}

/* ── Mobile & tablet: centred content ── */
@media (max-width: 991.98px) {
    .auth-mobile-brand {
        justify-content: center;
    }

    .auth-head {
        text-align: center;
    }

    .auth-head p {
        margin-inline: auto;
        max-width: 360px;
    }

    .auth-panel {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

@media (max-width: 575.98px) {
    /* short login card sits in the middle of the screen; long register form starts at the top */
    .auth-panel:not(.align-top) {
        align-items: center;
    }

    .section-head {
        text-align: start;
    }
}

/* framed layout on shorter screens (e.g. 1440×900 laptops): keep everything inside the frame */
@media (min-width: 1400px) and (max-height: 1000px) {
    .auth-brand {
        gap: 1.4rem;
        padding-block: 2rem;
    }

    .preview-body {
        display: none;
    }
}

/* ── Language switch (top corner of the form panel) ── */
.auth-panel {
    position: relative;
}

.lang-switch {
    position: absolute;
    top: 1.25rem;
    inset-inline-end: 1.25rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 36px;
    padding: 0 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-2);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lang-switch:hover {
    color: var(--text);
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.06);
}

.lang-switch i {
    color: var(--accent);
}

/* Arabic text: use the system's Arabic UI fonts (Inter has no Arabic glyphs) */
html[lang="ar"] body.auth-body {
    font-family: 'Inter', 'Segoe UI', Tahoma, 'Geeza Pro', 'Noto Sans Arabic', system-ui, sans-serif;
}

html[lang="ar"] .brand-title,
html[lang="ar"] .auth-head h1,
html[lang="ar"] .auth-head h2 {
    letter-spacing: 0;
    line-height: 1.3;
}

@media (max-width: 991.98px) {
    .auth-panel,
    .auth-panel.align-top {
        padding-top: 4.25rem;
    }

    .lang-switch {
        top: 1rem;
        inset-inline-end: 1rem;
    }
}
