:root {
    /* Premium SaaS Theme (Indigo/Slate) */
    --bg-dark: #0f172a;
    /* Slate 900 */
    --bg-dark-soft: #1e293b;
    /* Slate 800 */
    --primary-color: #5b21b6;
    /* Indigo 600 */
    --primary-hover: #5b21b6;
    /* Indigo 700 */
    --secondary-color: #6366f1;
    /* Indigo 500 */
    --accent-color: #818cf8;
    /* Indigo 400 */
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --border-color: #334155;
    /* Slate 700 */
    --input-bg: #1e293b;
    /* Slate 800 */

    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --font-sans: "Inter", "Cairo", "Segoe UI", "SF Pro Text", "Helvetica Neue", Arial, system-ui, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    /* Prevent scroll */
}

/* Split Layout */
.split-screen {
    display: flex;
    height: 100vh;
    width: 100vw;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   LEFT SIDE: VISUAL UNIVERSE
   ========================================================= */
.visual-side {
    display: none;
    flex: 1;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
    position: relative;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Background Grid */
.visual-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(99, 102, 241, 0.15) 1px, transparent 1px),
        radial-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 40px 40px, 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.5;
    z-index: 0;
}

/* The SaaS Universe System */
.saas-universe {
    position: relative;
    width: 600px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Central Hub (Core Intelligence) */
.core-hub {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 60px rgba(79, 70, 229, 0.5);
    z-index: 10;
    position: relative;
    animation: pulseCore 3s infinite ease-in-out;
}

.core-icon {
    font-size: 48px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Orbit Rings */
.orbit-ring {
    position: absolute;
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-1 {
    width: 220px;
    height: 220px;
    animation: spinRight 20s linear infinite;
}

.orbit-2 {
    width: 380px;
    height: 380px;
    animation: spinLeft 30s linear infinite;
}

.orbit-3 {
    width: 540px;
    height: 540px;
    animation: spinRight 45s linear infinite;
    opacity: 0.5;
    border-style: dashed;
}

/* Orbiting Nodes (Features) */
.node {
    position: absolute;
    width: 48px;
    height: 48px;
    background: var(--bg-dark-soft);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Correct counter-rotation to keep icons upright */
}

.orbit-1 .node {
    animation: spinLeft 20s linear infinite;
}

.orbit-2 .node {
    animation: spinRight 30s linear infinite;
}

.node-chat {
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
}

.node-comments {
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
}

.node-analytics {
    top: 50%;
    right: -24px;
    transform: translateY(-50%);
}

.node-auto {
    top: 50%;
    left: -24px;
    transform: translateY(-50%);
}

/* Feature Text Overlay */
.feature-content {
    position: absolute;
    bottom: 60px;
    left: 60px;
    z-index: 10;
    text-align: left;
}

.feature-title {
    font-family: 'Outfit', sans-serif;
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 16px 0;
    background: linear-gradient(to right, #fff, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.feature-desc {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.6;
}

/* Animations */
@keyframes pulseCore {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 60px rgba(79, 70, 229, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 100px rgba(79, 70, 229, 0.7);
    }
}

@keyframes spinRight {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes spinLeft {
    from {
        transform: translate(-50%, -50%) rotate(360deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}


/* =========================================================
   RIGHT SIDE: AUTH FORM
   ========================================================= */
.auth-side {
    width: 100%;
    max-width: 520px;
    flex-shrink: 0;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    border-left: none;
    position: relative;
    z-index: 10;
    color-scheme: dark;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    transition: max-width 0.24s ease;
}

.auth-wrapper.auth-wrapper--signup {
    max-width: 420px;
}

.auth-wrapper.auth-wrapper--forgot {
    max-width: 380px;
}

.auth-panel {
    width: 100%;
}

.auth-panel[hidden] {
    display: none !important;
}

.auth-panel--signin {
    max-width: 360px;
    margin: 0 auto;
}

.auth-panel--signup {
    max-width: 420px;
    margin: 0 auto;
}

.auth-panel--forgot {
    max-width: 380px;
    margin: 0 auto;
}

.logo-area {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-brand-lockup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-main);
}

.auth-brand-lockup__logo {
    width: 42px;
    height: auto;
    display: block;
    filter: brightness(0) invert(1) drop-shadow(0 10px 22px rgba(255, 255, 255, 0.14));
}

.auth-brand-lockup__name {
    font-family: var(--font-sans);
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--text-main);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header--minimal {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.auth-header--signup {
    margin-bottom: 24px;
}

.auth-header--forgot {
    margin-bottom: 22px;
}

.auth-panel-title {
    margin: 0 0 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-align: center;
}

.auth-header__eyebrow {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.88);
}

.auth-header__subtext {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 280px;
}

.auth-header__subtext--signup {
    max-width: none;
    text-align: center;
}

/* Social Buttons */
.social-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-dark-soft);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.social-btn__icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.social-btn__icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.social-btn__icon img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.social-btn:hover {
    background: #334155;
    border-color: #475569;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 10px;
}

/* Form Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.auth-side .form-group label.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc !important;
    margin-bottom: 4px;
    text-align: left;
    /* Ensure label aligns */
}

[dir="rtl"] .auth-side .form-group label.form-label {
    text-align: right;
}

.form-label-row .form-label {
    margin-bottom: 0;
}

.form-input-wrapper {
    position: relative;
}

.auth-side .form-group .form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--input-bg);
    background-color: var(--input-bg);
    border: none !important;
    border-radius: 8px;
    color: #f8fafc;
    caret-color: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

.auth-side .form-group .form-input::placeholder {
    color: rgba(226, 232, 240, 0.48);
}

.auth-side .form-group .form-input:focus {
    outline: none;
    border: none !important;
    box-shadow: none !important;
}

.auth-side .form-group .form-input:-webkit-autofill,
.auth-side .form-group .form-input:-webkit-autofill:hover,
.auth-side .form-group .form-input:-webkit-autofill:focus,
.auth-side .form-group .form-input:-webkit-autofill:active {
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc;
    background-color: var(--input-bg) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    border-radius: 8px;
    border: none !important;
    outline: none;
    transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
}

.auth-side .form-group .form-input.is-invalid,
.auth-side .form-group .form-input.is-invalid:focus {
    background: var(--input-bg) !important;
    border: none !important;
    box-shadow: none !important;
}

.auth-side .remember-me.is-invalid {
    background: transparent !important;
}

@keyframes authFieldShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.auth-side .form-group .form-input.shake,
.auth-side .remember-me.shake {
    animation: authFieldShake .35s ease-in-out;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

[dir="rtl"] .password-toggle {
    right: auto;
    left: 12px;
}

.password-toggle__icon {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(100%);
    opacity: 0.92;
}

.password-toggle__icon--visible {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle__icon--hidden {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle__icon--visible {
    display: block;
}

/* Form Footer */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.form-footer--terms {
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 18px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-me input {
    accent-color: var(--primary-color);
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.remember-me--terms {
    color: #cbd5e1;
    line-height: 1.55;
}

.remember-me--terms span {
    display: inline-block;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

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

/* Submit Button */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary--signup {
    margin-top: 2px;
}

.auth-status-card {
    margin: 0 0 18px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    line-height: 1.6;
    text-align: center;
}

.auth-status-card p {
    margin: 0;
    font-size: 14px;
}


/* Signup Link */
.signup-text {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.signup-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

[dir="rtl"] .signup-text a {
    margin-left: 0;
    margin-right: 4px;
}

.signup-text a:hover {
    text-decoration: underline;
}

.signup-text--inline {
    margin-top: 20px;
}

.signup-recaptcha-row {
    display: flex;
    justify-content: center;
    margin: 8px 0 18px;
}

.signup-recaptcha-row .g-recaptcha {
    transform-origin: center top;
}

/* Mobile */
@media (max-width: 900px) {
    .split-screen {
        flex-direction: column-reverse;
    }

    .visual-side {
        display: none;
    }

    /* Hide complicated visual on mobile for speed/focus */
    .auth-side {
        width: 100%;
        height: 100vh;
        border-left: none;
    }

    .auth-brand-lockup__name {
        font-size: 38px;
    }
}

@media (max-width: 480px) {
    .auth-side {
        padding: 40px 24px;
    }

    .auth-wrapper {
        max-width: 100%;
    }

    .auth-panel--signin,
    .auth-panel--signup {
        max-width: 100%;
    }

    .auth-brand-lockup {
        gap: 12px;
    }

    .auth-brand-lockup__logo {
        width: 36px;
    }

    .auth-brand-lockup__name {
        font-size: 34px;
    }

    .auth-header__eyebrow {
        font-size: 14px;
    }

    .auth-header__subtext {
        font-size: 13px;
        max-width: 260px;
    }

    .auth-panel-title {
        font-size: 24px;
    }

    .signup-recaptcha-row .g-recaptcha {
        transform: scale(0.92);
    }
}
