/* ================================================================
   BUSINESS FLOW — Auth Pages (Login + Register)
   Theme: Deep Navy — matching Landing & Dashboard
================================================================ */

/* ── BASE OVERRIDES ── */
body.public-page {
    background: #050d1f !important;
    min-height: 100vh;
}

/* ── AUTH WRAP ── */
.auth-wrap {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

    /* Background layers */
    .auth-wrap::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 0;
        background: radial-gradient(ellipse 70% 60% at 20% 30%, rgba(30,58,138,.3) 0%, transparent 55%), radial-gradient(ellipse 60% 55% at 80% 70%, rgba(190,18,60,.18) 0%, transparent 50%), radial-gradient(ellipse 80% 70% at 50% 50%, rgba(13,148,136,.1) 0%, transparent 60%);
        pointer-events: none;
    }

    /* Animated grid */
    .auth-wrap::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 0;
        background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
        background-size: 50px 50px;
        animation: auth-grid-drift 25s linear infinite;
        pointer-events: none;
    }

@keyframes auth-grid-drift {
    0% {
        background-position: 0 0, 0 0;
    }

    100% {
        background-position: 50px 50px, 50px 50px;
    }
}

/* ── AUTH CARD (Login) ── */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    background: linear-gradient(145deg, rgba(14,28,70,.95) 0%, rgba(20,38,88,.92) 50%, rgba(15,24,58,.95) 100%);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 24px;
    padding: 36px 40px 40px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 40px 100px rgba(0,0,0,.55), 0 0 60px rgba(30,58,138,.15);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

    /* Top shimmer line */
    .auth-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(99,102,241,.7) 30%, rgba(190,18,60,.5) 70%, transparent);
    }

    /* Subtle inner glow */
    .auth-card::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(30,58,138,.1) 0%, transparent 60%);
        pointer-events: none;
    }

/* Auth head */
.auth-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

/* ── BADGE ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 40px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(200,214,255,.8);
}

/* Auth title */
.auth-card h2 {
    font-family: 'DM Serif Display', 'Georgia', serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.auth-card > p {
    font-size: .84rem;
    color: rgba(165,184,255,.6);
    line-height: 1.65;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

/* ── FORM FIELDS ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

    .field label {
        font-size: .78rem;
        font-weight: 600;
        color: rgba(165,184,255,.7);
        letter-spacing: .02em;
    }

.input {
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    border-radius: 10px !important;
    padding: 11px 14px !important;
    color: #fff !important;
    font-size: .88rem !important;
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
    transition: border-color .2s, background .2s, box-shadow .2s !important;
    width: 100% !important;
    direction: rtl;
}

    .input:focus {
        outline: none !important;
        background: rgba(255,255,255,.09) !important;
        border-color: rgba(99,102,241,.5) !important;
        box-shadow: 0 0 0 3px rgba(99,102,241,.1) !important;
    }

    .input::placeholder {
        color: rgba(165,184,255,.3) !important;
    }

    .input option {
        background: #0f1c3d;
        color: #fff;
    }

select.input {
    cursor: pointer;
}

/* Error alert */
.alert.bad {
    padding: 11px 15px;
    border-radius: 10px;
    background: rgba(190,18,60,.1);
    border: 1px solid rgba(190,18,60,.25);
    color: #fda4af;
    font-size: .84rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

/* ── ACTIONS ── */
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

    .actions a {
        font-size: .8rem;
        color: rgba(165,184,255,.5);
        transition: color .2s;
        text-decoration: none;
    }

        .actions a:hover {
            color: rgba(165,184,255,.9);
        }

/* Remember checkbox */
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: rgba(165,184,255,.6);
    cursor: pointer;
}

    .check input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: #6366f1;
        cursor: pointer;
    }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 24px;
    border-radius: 40px;
    font-size: .87rem;
    font-weight: 700;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    cursor: pointer;
    border: none;
    transition: all .22s ease;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #4c6ef5 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(30,58,138,.4);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(30,58,138,.55);
        background: linear-gradient(135deg, #2d52c4 0%, #5a7ff8 100%);
        color: #fff;
    }

.btn-outline {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14) !important;
    color: rgba(200,214,255,.75);
}

    .btn-outline:hover {
        background: rgba(255,255,255,.12);
        color: #fff;
        transform: translateY(-1px);
    }

.btn-spark {
    font-size: .75rem;
    opacity: .7;
}

/* ================================================================
   REGISTER — AI CARD EXTENDED
================================================================ */
.auth-card.ai-reg {
    max-width: 900px;
    padding: 28px 32px 36px;
}

/* AI register 2-col grid */
.ai-reg-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* ── STEPS ── */
.ai-steps {
    margin-bottom: 24px;
}

.ai-progress {
    height: 3px;
    background: rgba(255,255,255,.07);
    border-radius: 2px;
    margin-bottom: 14px;
    overflow: hidden;
}

    .ai-progress span {
        display: block;
        height: 100%;
        background: linear-gradient(90deg, #6366f1, #f43f5e);
        border-radius: 2px;
        transition: width .4s ease;
        width: 25%;
    }

.ai-steps-row {
    display: flex;
    gap: 8px;
}

.ai-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    color: rgba(165,184,255,.4);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

    .ai-step .n {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: rgba(255,255,255,.06);
        border: 1px solid rgba(255,255,255,.1);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: .72rem;
        flex-shrink: 0;
    }

    .ai-step.active {
        background: rgba(99,102,241,.12);
        border-color: rgba(99,102,241,.3);
        color: #a5b4fc;
    }

        .ai-step.active .n {
            background: rgba(99,102,241,.2);
            border-color: rgba(99,102,241,.4);
            color: #c7d2fe;
        }

    .ai-step.done {
        background: rgba(34,197,94,.08);
        border-color: rgba(34,197,94,.2);
        color: #86efac;
    }

        .ai-step.done .n {
            background: rgba(34,197,94,.15);
            border-color: rgba(34,197,94,.3);
        }

/* ── PANEL HEAD ── */
.ai-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.ai-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.spark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(99,102,241,.15);
    border: 1px solid rgba(99,102,241,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
    color: #a5b4fc;
}

.ai-title .h {
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
}

.ai-title .p {
    font-size: .75rem;
    color: rgba(165,184,255,.5);
}

.ai-chip {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 800;
    background: rgba(99,102,241,.15);
    border: 1px solid rgba(99,102,241,.3);
    color: #a5b4fc;
    animation: ai-pulse-chip 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes ai-pulse-chip {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(99,102,241,.3);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(99,102,241,.0);
    }
}

/* Step panels */
.step-panel {
    display: none;
}

    .step-panel.active {
        display: block;
    }

.ai-sub {
    font-size: .83rem;
    color: rgba(165,184,255,.55);
    margin-bottom: 18px;
    line-height: 1.65;
}

    .ai-sub .muted {
        opacity: .6;
    }

.ai-help {
    font-size: .74rem;
    color: rgba(165,184,255,.4);
    margin-top: 4px;
    display: block;
}

/* Note box */
.ai-note {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(34,197,94,.07);
    border: 1px solid rgba(34,197,94,.18);
    margin-top: 16px;
    margin-bottom: 4px;
}

    .ai-note .k {
        font-size: .8rem;
        font-weight: 700;
        color: #86efac;
        margin-bottom: 5px;
    }

    .ai-note .v {
        font-size: .78rem;
        color: rgba(165,184,255,.55);
        line-height: 1.6;
    }

/* Alert generic */
.alert {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(99,102,241,.08);
    border: 1px solid rgba(99,102,241,.18);
    color: #c7d2fe;
    font-size: .82rem;
    margin-bottom: 14px;
}

/* ── SERVICE PICK GRID ── */
.ai-picks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.ai-pick {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 14px;
    text-align: right;
    direction: rtl;
    cursor: pointer;
    transition: all .2s;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    color: #fff;
    position: relative;
}

    .ai-pick:hover {
        background: rgba(255,255,255,.07);
        border-color: rgba(99,102,241,.3);
    }

    .ai-pick.chosen {
        background: rgba(99,102,241,.12);
        border-color: rgba(99,102,241,.35);
    }

.ai-pick-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

    .ai-pick-top b {
        font-size: .82rem;
        font-weight: 700;
    }

.ai-tag {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(99,102,241,.15);
    border: 1px solid rgba(99,102,241,.25);
    color: #a5b4fc;
    white-space: nowrap;
}

.ai-pick small {
    font-size: .75rem;
    color: rgba(165,184,255,.45);
    line-height: 1.45;
    display: block;
    margin-bottom: 10px;
}

.ai-pick-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-free {
    font-size: .72rem;
    color: rgba(165,184,255,.4);
}

.ai-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(99,102,241,.15);
    border: 1px solid rgba(99,102,241,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    color: #a5b4fc;
    opacity: 0;
    transition: opacity .2s;
}

.ai-pick.chosen .ai-check {
    opacity: 1;
}

.ai-pick input[type="checkbox"] {
    display: none;
}

/* Selected box */
.ai-selected {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 4px;
}

    .ai-selected h4 {
        font-size: .78rem;
        font-weight: 700;
        color: rgba(165,184,255,.5);
        margin-bottom: 10px;
        text-transform: uppercase;
        letter-spacing: .08em;
    }

.selected-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
}

    .selected-list li {
        padding: 4px 12px;
        border-radius: 20px;
        background: rgba(99,102,241,.12);
        border: 1px solid rgba(99,102,241,.25);
        font-size: .78rem;
        color: #c7d2fe;
    }

.ai-bundle {
    font-size: .78rem;
    color: #86efac;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(34,197,94,.07);
    border: 1px solid rgba(34,197,94,.18);
    border-radius: 8px;
}

/* ── RIGHT: AI ASSISTANT ── */
.ai-reg-side {
    align-self: start;
}

.ai-side-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 18px;
    position: sticky;
    top: 80px;
}

.ai-side-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ai-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    animation: ai-dot-pulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes ai-dot-pulse {
    0%,100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .4;
        transform: scale(.7);
    }
}

.ai-side-title {
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
}

.ai-side-sub {
    font-size: .74rem;
    color: rgba(165,184,255,.45);
}

.ai-bubble {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(99,102,241,.1);
    border: 1px solid rgba(99,102,241,.2);
    font-size: .8rem;
    color: #c7d2fe;
    line-height: 1.6;
    margin-bottom: 16px;
    transition: all .3s;
}

.ai-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.ai-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    font-size: .78rem;
}

    .ai-summary-row .k {
        color: rgba(165,184,255,.45);
        flex-shrink: 0;
    }

    .ai-summary-row .v {
        color: rgba(255,255,255,.75);
        text-align: left;
    }

.ai-pill {
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.25);
    color: #fbbf24;
    font-size: .7rem;
    font-weight: 700;
}

.ai-side-foot {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-foot-line {
    font-size: .76rem;
    color: rgba(165,184,255,.4);
    padding: 5px 0;
    border-top: 1px solid rgba(255,255,255,.05);
}

/* ── TERMS CHECKBOX ── */
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: rgba(165,184,255,.6);
    cursor: pointer;
    margin: 12px 0;
}

    .check input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: #6366f1;
        cursor: pointer;
    }

/* ── OVERLAY ── */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(5,13,31,.92);
    backdrop-filter: blur(16px);
    align-items: center;
    justify-content: center;
}

    .overlay.active {
        display: flex;
    }

.overlay-card {
    text-align: center;
    background: rgba(14,28,70,.9);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    padding: 40px 48px;
    box-shadow: 0 40px 100px rgba(0,0,0,.5);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(99,102,241,.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── SCROLL REVEAL ── */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s ease, transform .5s ease;
}

    .reveal.visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
    .auth-card.ai-reg {
        padding: 20px 18px 28px;
    }

    .ai-reg-grid {
        grid-template-columns: 1fr;
    }

    .ai-reg-side {
        display: none;
    }

    .ai-picks {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 24px 20px 30px;
    }
}

@media (max-width: 480px) {
    .ai-picks {
        grid-template-columns: 1fr;
    }

    .ai-steps-row {
        gap: 5px;
    }

    .ai-step .t {
        display: none;
    }
}
