/* ============================================================
   Theme Index3: "Bold Professional" — Split Layout
   Bootstrap 5 + CSS Animations
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --idx3-primary: #0ea5e9;
    --idx3-primary-rgb: 14, 165, 233;
    --idx3-primary-light: #38bdf8;
    --idx3-primary-dark: #0284c7;
    --idx3-accent: #6366f1;
    --idx3-accent-rgb: 99, 102, 241;
    --idx3-secondary: #f59e0b;
    --idx3-secondary-rgb: 245, 158, 11;
    --idx3-success: #10b981;
    --idx3-text: #0f172a;
    --idx3-text-muted: #64748b;
    --idx3-text-light: #94a3b8;
    --idx3-border: #e2e8f0;
    --idx3-input-bg: #f8fafc;
    --idx3-input-border: #cbd5e1;
    --idx3-radius: 1.25rem;
    --idx3-radius-sm: 0.75rem;

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

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

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

/* --- Split Layout --- */
.idx3-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

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

/* Right pane: image */
.idx3-image-pane {
    flex: 1 1 52%;
    display: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #f0f9ff 0%, #e0f2fe 30%, #bae6fd 100%);
}

.idx3-image-pane .idx3-bg-image {
    width: 85%;
    max-width: 520px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: idx3Float 5s ease-in-out infinite;
    filter: drop-shadow(0 15px 30px rgba(14, 165, 233, 0.08));
}

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

/* Decorative elements */
.idx3-image-pane .idx3-deco {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
}

.idx3-image-pane .idx3-deco-1 {
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, rgba(var(--idx3-primary-rgb), 0.5), rgba(var(--idx3-accent-rgb), 0.3));
    top: 8%;
    right: -50px;
    animation: idx3Drift1 18s ease-in-out infinite alternate;
}

.idx3-image-pane .idx3-deco-2 {
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg, rgba(var(--idx3-secondary-rgb), 0.4), rgba(var(--idx3-primary-rgb), 0.2));
    bottom: 12%;
    left: -30px;
    animation: idx3Drift2 22s ease-in-out infinite alternate;
}

.idx3-image-pane .idx3-deco-3 {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(var(--idx3-accent-rgb), 0.4), rgba(var(--idx3-primary-rgb), 0.2));
    top: 55%;
    right: 10%;
    animation: idx3Drift3 15s ease-in-out infinite alternate;
}

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

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

.idx3-art-brand h5 {
    color: var(--idx3-primary-dark);
    font-weight: 800;
    font-size: 1.05rem;
}

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

@media (min-width: 992px) {
    .idx3-image-pane { display: block; }
}

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

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

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

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

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

.language-changer > a {
    background: #f0f9ff;
    color: var(--idx3-text);
    border: 1px solid var(--idx3-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(--idx3-primary), var(--idx3-primary-dark));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(var(--idx3-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(--idx3-border);
    border-radius: var(--idx3-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(--idx3-primary-rgb), 0.06);
}

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

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

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

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

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

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

.idx3-subtitle {
    color: var(--idx3-text-muted);
    font-size: 0.92rem;
}

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

.idx3-nav-pills .nav-link {
    color: var(--idx3-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;
}

.idx3-nav-pills .nav-link:hover {
    color: var(--idx3-primary);
    background: rgba(var(--idx3-primary-rgb), 0.06);
}

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

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

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

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

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

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

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

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

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

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

.idx3-info-banner i { color: var(--idx3-primary); }
.idx3-info-banner h6 { color: var(--idx3-text); font-size: 0.88rem; font-weight: 700; }
.idx3-info-banner p { color: var(--idx3-text-muted); font-size: 0.82rem; line-height: 1.5; }

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

.idx3-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;
}

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

.idx3-btn-primary:hover::before { left: 100%; }
.idx3-btn-primary:active { transform: translateY(0); }

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

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

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

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

.idx3-link:hover { color: var(--idx3-primary); }
.idx3-link:hover::after { width: 100%; }

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

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

/* --- Form Text --- */
.idx3-form-text { color: var(--idx3-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 --- */
.idx3-register-container .form-control,
.idx3-register-container .form-select {
    background: var(--idx3-input-bg);
    border: 1.5px solid var(--idx3-input-border);
    border-radius: var(--idx3-radius-sm);
    transition: all 0.3s ease;
}

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

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

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

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

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

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

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

.idx3-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;
}

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

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

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

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

.idx3-fade-in { animation: idx3FadeInUp 0.5s ease-out both; }

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

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

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .idx3-topbar { padding: 0.85rem 1.25rem; }
    .idx3-form-content { padding: 1rem 1.25rem; }
}

@media (max-width: 575.98px) {
    .idx3-title { font-size: 1.35rem; }
    .idx3-header-icon { width: 50px; height: 50px; }
    .idx3-header-icon i { font-size: 1.3rem; }
    .idx3-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"] {
    --idx3-text: #e2e8f0;
    --idx3-text-muted: #94a3b8;
    --idx3-text-light: #64748b;
    --idx3-border: rgba(255,255,255,0.08);
    --idx3-input-bg: #161926;
    --idx3-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;
}

/* Index3-specific dark overrides */
[data-bs-theme="dark"] .idx3-form-pane {
    background: #0f1117;
}
[data-bs-theme="dark"] .idx3-image-pane {
    background: linear-gradient(160deg, #0c1220 0%, #111827 30%, #1a1d2e 100%);
}
[data-bs-theme="dark"] .idx3-nav-pills {
    background: #161926;
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .idx3-btn-outline {
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
}
[data-bs-theme="dark"] .idx3-btn-outline:hover {
    background: rgba(14,165,233,0.08);
    border-color: var(--idx3-primary);
    color: var(--idx3-primary);
}
[data-bs-theme="dark"] .language-changer > a {
    background: #161926;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.08);
}
[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.08);
}
[data-bs-theme="dark"] .country-wrap .dropdown-item {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .country-wrap .dropdown-item:hover {
    background: rgba(14,165,233,0.1);
}
[data-bs-theme="dark"] .idx3-input:focus {
    background: #1a1d2e !important;
}
[data-bs-theme="dark"] .idx3-info-banner {
    background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(99,102,241,0.05));
    border-color: rgba(14,165,233,0.15);
}
[data-bs-theme="dark"] .idx3-register-container .form-control:focus,
[data-bs-theme="dark"] .idx3-register-container .form-select:focus {
    background: #1a1d2e;
}
[data-bs-theme="dark"] .idx3-register-container .form-select {
    background-color: #161926;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .modal-content {
    background: #1a1d2e !important;
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .modal-header {
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .modal-footer {
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}
