/* ============================================================
   Theme Index2: "Split Elegance" — Two-Pane Premium Layout
   Bootstrap 5 + CSS Animations
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --idx2-primary: #4f46e5;
    --idx2-primary-rgb: 79, 70, 229;
    --idx2-primary-light: #818cf8;
    --idx2-primary-dark: #3730a3;
    --idx2-accent: #06b6d4;
    --idx2-accent-rgb: 6, 182, 212;
    --idx2-secondary: #f43f5e;
    --idx2-secondary-rgb: 244, 63, 94;
    --idx2-success: #10b981;
    --idx2-text: #1e293b;
    --idx2-text-muted: #64748b;
    --idx2-text-light: #94a3b8;
    --idx2-border: #e2e8f0;
    --idx2-input-bg: #f8fafc;
    --idx2-input-border: #cbd5e1;
    --idx2-radius: 1.25rem;
    --idx2-radius-sm: 0.75rem;
    --idx2-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --idx2-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.1);

    /* Shared component aliases */
    --aff-primary: var(--idx2-primary);
    --aff-primary-rgb: var(--idx2-primary-rgb);
    --aff-primary-dark: var(--idx2-primary-dark);
    --aff-primary-light: var(--idx2-primary-light);
    --aff-text: var(--idx2-text);
    --aff-text-muted: var(--idx2-text-muted);
    --aff-radius: var(--idx2-radius-sm);
    --aff-input-bg: var(--idx2-input-bg);
    --aff-input-border: var(--idx2-input-border);
}

/* --- Base --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background: #f0f2f8;
    color: var(--idx2-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Two-Pane Layout --- */
.idx2-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left pane: form side */
.idx2-form-pane {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

/* Right pane: decorative illustration */
.idx2-art-pane {
    flex: 1 1 50%;
    display: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 30%, #ddd6fe 60%, #ede9fe 100%);
    background-size: 300% 300%;
    animation: idx2GradientShift 12s ease infinite;
}

@keyframes idx2GradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.idx2-art-pane .idx2-art-illustration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75%;
    max-width: 420px;
    height: auto;
    animation: idx2Float 6s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(79, 70, 229, 0.1));
}

@keyframes idx2Float {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, calc(-50% - 12px)); }
}

/* Decorative circles on art pane */
.idx2-art-pane .idx2-deco-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
}

.idx2-art-pane .idx2-deco-circle-1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(var(--idx2-primary-rgb), 0.5), rgba(var(--idx2-accent-rgb), 0.3));
    top: 10%;
    right: -40px;
    animation: idx2CircleDrift1 16s ease-in-out infinite alternate;
}

.idx2-art-pane .idx2-deco-circle-2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, rgba(var(--idx2-secondary-rgb), 0.4), rgba(var(--idx2-primary-rgb), 0.2));
    bottom: 15%;
    left: -30px;
    animation: idx2CircleDrift2 20s ease-in-out infinite alternate;
}

.idx2-art-pane .idx2-deco-circle-3 {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(var(--idx2-accent-rgb), 0.4), rgba(var(--idx2-primary-rgb), 0.2));
    top: 60%;
    right: 15%;
    animation: idx2CircleDrift3 14s ease-in-out infinite alternate;
}

@keyframes idx2CircleDrift1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-20px, 30px) scale(1.1); }
}
@keyframes idx2CircleDrift2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.15); }
}
@keyframes idx2CircleDrift3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-15px, -25px) scale(0.9); }
}

/* Art pane brand text */
.idx2-art-brand {
    position: absolute;
    bottom: 2.5rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
}

.idx2-art-brand h5 {
    color: var(--idx2-primary-dark);
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.idx2-art-brand p {
    color: var(--idx2-text-muted);
    font-size: 0.85rem;
}

/* Show right pane on desktop */
@media (min-width: 992px) {
    .idx2-art-pane {
        display: block;
    }
}

/* --- Top Bar (navbar area) --- */
.idx2-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    flex-shrink: 0;
}

.idx2-topbar .navbar-brand img {
    max-width: 180px;
    max-height: 45px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.idx2-topbar .navbar-brand img:hover {
    transform: scale(1.04);
}

.idx2-topbar .navbar-brand img.customLogoClass {
    max-width: none;
    max-height: none;
}

/* Language dropdown */
.language-changer {
    position: relative;
    color: var(--idx2-text);
}

.language-changer > a {
    background: #f8fafc;
    color: var(--idx2-text);
    border: 1px solid var(--idx2-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.language-changer > a:hover,
.language-changer > a:focus {
    background: linear-gradient(135deg, var(--idx2-primary), var(--idx2-primary-light));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(var(--idx2-primary-rgb), 0.3);
}

.selected-language {
    width: 24px;
    margin-right: 8px;
}

.country-wrap .dropdown-item img {
    width: 20px;
    margin-right: 8px;
}

.dropdown-menu.country-wrap,
.country-wrap.dropdown-menu {
    border: 1px solid var(--idx2-border);
    border-radius: var(--idx2-radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

.country-wrap .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.country-wrap .dropdown-item:hover {
    background: rgba(var(--idx2-primary-rgb), 0.06);
}

/* --- Form Content Area --- */
.idx2-form-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 2rem 2rem;
    overflow-y: auto;
}

.idx2-form-wrapper {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
}

/* --- Header Icon --- */
.idx2-header-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--idx2-primary), var(--idx2-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 6px 20px rgba(var(--idx2-primary-rgb), 0.25);
    animation: idx2IconPulse 3s ease-in-out infinite;
}

.idx2-header-icon i {
    font-size: 1.5rem;
    color: #fff;
}

@keyframes idx2IconPulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(var(--idx2-primary-rgb), 0.25); }
    50% { box-shadow: 0 6px 28px rgba(var(--idx2-primary-rgb), 0.4); }
}

.idx2-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--idx2-text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.idx2-subtitle {
    color: var(--idx2-text-muted);
    font-size: 0.92rem;
    margin-bottom: 0;
}

/* --- Nav Pills --- */
.idx2-nav-pills {
    background: #f1f5f9;
    border-radius: var(--idx2-radius-sm);
    padding: 0.25rem;
    border: 1px solid var(--idx2-border);
}

.idx2-nav-pills .nav-link {
    color: var(--idx2-text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.6rem;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
}

.idx2-nav-pills .nav-link:hover {
    color: var(--idx2-text);
    background: rgba(var(--idx2-primary-rgb), 0.05);
}

.idx2-nav-pills .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--idx2-primary), var(--idx2-primary-dark));
    box-shadow: 0 4px 12px rgba(var(--idx2-primary-rgb), 0.3);
}

/* --- Floating Label Inputs --- */
.idx2-input-group {
    position: relative;
}

.idx2-input {
    background: var(--idx2-input-bg) !important;
    border: 1.5px solid var(--idx2-input-border) !important;
    border-radius: var(--idx2-radius-sm) !important;
    color: var(--idx2-text) !important;
    height: 56px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding-right: 3rem;
}

.idx2-input::placeholder {
    color: transparent;
}

.idx2-input:focus {
    background: #fff !important;
    border-color: var(--idx2-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--idx2-primary-rgb), 0.1), 0 4px 16px rgba(var(--idx2-primary-rgb), 0.06) !important;
}

.idx2-input-group label {
    color: var(--idx2-text-muted);
    font-size: 0.9rem;
}

.idx2-input-group .form-control:focus ~ label,
.idx2-input-group .form-control:not(:placeholder-shown) ~ label {
    color: var(--idx2-primary);
}

/* Password toggle */
.idx2-input-group .toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    z-index: 5;
    color: var(--idx2-text-light);
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.idx2-input-group .toggle-password:hover {
    color: var(--idx2-primary);
    background: rgba(var(--idx2-primary-rgb), 0.08);
}

/* --- Info Banner --- */
.idx2-info-banner {
    background: linear-gradient(135deg, rgba(var(--idx2-primary-rgb), 0.05), rgba(var(--idx2-accent-rgb), 0.03));
    border: 1px solid rgba(var(--idx2-primary-rgb), 0.1);
    border-left: 3px solid var(--idx2-primary);
    border-radius: var(--idx2-radius-sm);
    padding: 1rem 1.15rem;
}

.idx2-info-banner i {
    color: var(--idx2-primary);
}

.idx2-info-banner h6 {
    color: var(--idx2-text);
    font-size: 0.88rem;
    font-weight: 700;
}

.idx2-info-banner p {
    color: var(--idx2-text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* --- Buttons --- */
.idx2-btn-primary {
    background: linear-gradient(135deg, var(--idx2-primary), var(--idx2-primary-dark));
    background-size: 200% 200%;
    border: none;
    color: #fff;
    border-radius: var(--idx2-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    transition: all 0.35s ease;
    box-shadow: 0 4px 15px rgba(var(--idx2-primary-rgb), 0.25);
}

.idx2-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.5s ease;
}

.idx2-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--idx2-primary-rgb), 0.35);
    color: #fff;
}

.idx2-btn-primary:hover::before {
    left: 100%;
}

.idx2-btn-primary:active {
    transform: translateY(0);
}

.idx2-btn-outline {
    background: transparent;
    border: 1.5px solid var(--idx2-border);
    color: var(--idx2-text-muted);
    border-radius: var(--idx2-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.idx2-btn-outline:hover {
    background: #f8fafc;
    border-color: var(--idx2-primary);
    color: var(--idx2-primary);
    transform: translateY(-1px);
}

/* --- Links --- */
.idx2-link {
    color: var(--idx2-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 2px;
}

.idx2-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--idx2-primary), var(--idx2-primary-light));
    transition: width 0.3s ease;
    border-radius: 1px;
}

.idx2-link:hover {
    color: var(--idx2-primary);
}

.idx2-link:hover::after {
    width: 100%;
}

/* --- Trust Footer --- */
.idx2-trust-footer {
    padding-top: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--idx2-border);
    color: var(--idx2-text-light);
    font-size: 0.8rem;
}

.idx2-trust-footer i {
    color: var(--idx2-success);
}

/* --- Form Text --- */
.idx2-form-text {
    color: var(--idx2-text-light);
    font-size: 0.8rem;
}

/* --- Status Message --- */
#login-status-msg {
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 1.2rem;
}

/* --- Registration Form Overrides --- */
.idx2-register-container .form-control,
.idx2-register-container .form-select {
    background: var(--idx2-input-bg);
    border: 1.5px solid var(--idx2-input-border);
    border-radius: var(--idx2-radius-sm);
    transition: all 0.3s ease;
}

.idx2-register-container .form-control:focus,
.idx2-register-container .form-select:focus {
    background: #fff;
    border-color: var(--idx2-primary);
    box-shadow: 0 0 0 3px rgba(var(--idx2-primary-rgb), 0.1);
}

.idx2-register-container label {
    color: var(--idx2-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.idx2-register-container .btn-primary {
    background: linear-gradient(135deg, var(--idx2-primary), var(--idx2-primary-dark));
    border: none;
    border-radius: var(--idx2-radius-sm);
    box-shadow: 0 4px 15px rgba(var(--idx2-primary-rgb), 0.25);
    font-weight: 700;
    transition: all 0.35s ease;
}

.idx2-register-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--idx2-primary-rgb), 0.35);
}

.idx2-register-container .form-check-input:checked {
    background-color: var(--idx2-primary);
    border-color: var(--idx2-primary);
}

.idx2-register-container a {
    color: var(--idx2-primary);
    font-weight: 600;
}

/* --- Footer --- */
.idx2-footer {
    background: #0f172a;
    padding: 0.6rem 0;
    flex-shrink: 0;
    z-index: 1040;
}

.idx2-footer .nav-link {
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.idx2-footer .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
}

.idx2-footer .navbar-toggler-icon {
    filter: invert(1);
}

.idx2-footer-text {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
}

/* --- Animations --- */
@keyframes idx2FadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.idx2-fade-in {
    animation: idx2FadeInUp 0.5s ease-out both;
}

.idx2-stagger-1 { animation: idx2FadeInUp 0.5s ease-out 0.05s both; }
.idx2-stagger-2 { animation: idx2FadeInUp 0.5s ease-out 0.15s both; }
.idx2-stagger-3 { animation: idx2FadeInUp 0.5s ease-out 0.25s both; }
.idx2-stagger-4 { animation: idx2FadeInUp 0.5s ease-out 0.35s both; }
.idx2-stagger-5 { animation: idx2FadeInUp 0.5s ease-out 0.45s both; }
.idx2-stagger-6 { animation: idx2FadeInUp 0.5s ease-out 0.55s both; }

/* --- reCAPTCHA --- */
.grecaptcha-badge {
    z-index: 9999 !important;
}

/* --- Cookie Consent Override --- */
#cookie-consent-popup {
    bottom: 0 !important;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .idx2-form-pane {
        min-height: 100vh;
    }

    .idx2-topbar {
        padding: 0.85rem 1.25rem;
    }

    .idx2-form-content {
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .idx2-title {
        font-size: 1.35rem;
    }

    .idx2-header-icon {
        width: 52px;
        height: 52px;
    }

    .idx2-header-icon i {
        font-size: 1.3rem;
    }

    .idx2-nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-bs-theme="dark"] {
    --idx2-text: #e2e8f0;
    --idx2-text-muted: #94a3b8;
    --idx2-text-light: #64748b;
    --idx2-border: rgba(255,255,255,0.08);
    --idx2-input-bg: #161926;
    --idx2-input-border: rgba(255,255,255,0.1);
    --aff-text: #e2e8f0;
    --aff-text-muted: #94a3b8;
    --aff-input-bg: #161926;
    --aff-input-border: rgba(255,255,255,0.1);
    --aff-card-bg: #1a1d2e;
}
[data-bs-theme="dark"] body {
    background: #0f1117 !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .forny-container,
[data-bs-theme="dark"] .forny-form {
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .forny-container .card {
    background: #1a1d2e !important;
    border-color: rgba(255,255,255,0.08) !important;
}
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
    color: #f1f5f9 !important;
}
[data-bs-theme="dark"] .form-control {
    background: #161926 !important;
    color: #e2e8f0 !important;
    border-color: rgba(255,255,255,0.1) !important;
}
[data-bs-theme="dark"] label:not(.form-floating > label) {
    color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .form-floating > label {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .form-control:focus ~ label,
[data-bs-theme="dark"] .form-control:not(:placeholder-shown) ~ label {
    color: var(--aff-primary, #4361ee) !important;
    opacity: 1 !important;
}
[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] a:not(.btn) {
    color: #93c5fd;
}

/* Dark mode: Form pane */
[data-bs-theme="dark"] .idx2-form-pane {
    background: #0f1117;
}
/* Dark mode: Art pane */
[data-bs-theme="dark"] .idx2-art-pane {
    background: linear-gradient(135deg, #0f1117 0%, #161926 30%, #1a1d2e 60%, #10121c 100%);
}
[data-bs-theme="dark"] .idx2-art-brand h5 {
    color: #c7d2fe;
}
[data-bs-theme="dark"] .idx2-art-brand p {
    color: #94a3b8;
}
/* Dark mode: Nav pills */
[data-bs-theme="dark"] .idx2-nav-pills {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}
/* Dark mode: Input focus */
[data-bs-theme="dark"] .idx2-input:focus {
    background: #1e2235 !important;
}
/* Dark mode: Language dropdown */
[data-bs-theme="dark"] .language-changer > a {
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .dropdown-menu.country-wrap,
[data-bs-theme="dark"] .country-wrap.dropdown-menu {
    background: #1a1d2e;
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .country-wrap .dropdown-item {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .country-wrap .dropdown-item:hover {
    background: rgba(var(--idx2-primary-rgb),0.15);
}
/* Dark mode: Button outlines */
[data-bs-theme="dark"] .idx2-btn-outline {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.12);
    color: #cbd5e1;
}
[data-bs-theme="dark"] .idx2-btn-outline:hover {
    background: rgba(255,255,255,0.08);
}
/* Dark mode: Footer */
[data-bs-theme="dark"] .idx2-footer {
    background: #0a0c14;
}
/* Dark mode: Registration form overrides */
[data-bs-theme="dark"] .idx2-register-container .form-control,
[data-bs-theme="dark"] .idx2-register-container .form-select {
    background: #161926 !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .idx2-register-container .form-control:focus,
[data-bs-theme="dark"] .idx2-register-container .form-select:focus {
    background: #1e2235 !important;
}
