/* ============================================================
   Theme Index8: "Midnight Luxe" — White Card + Photo Desc Pane
   Bootstrap 5 + Raleway Fonts + Animations
   ============================================================ */

@font-face { font-family: 'Raleway Regular'; src: url(../fonts/Raleway-Medium.ttf); }
@font-face { font-family: 'Raleway Bold'; src: url(../fonts/Raleway-Bold.ttf); }
@font-face { font-family: 'Raleway Black'; src: url(../fonts/Raleway-Black.ttf); }

:root {
    --idx8-primary: #7c3aed;
    --idx8-primary-rgb: 124, 58, 237;
    --idx8-primary-light: #a78bfa;
    --idx8-primary-dark: #6d28d9;
    --idx8-accent: #8b5cf6;
    --idx8-accent-rgb: 139, 92, 246;
    --idx8-text: #1e1b2e;
    --idx8-text-muted: #64748b;
    --idx8-text-light: #94a3b8;
    --idx8-border: #e2e8f0;
    --idx8-input-bg: #f8fafc;
    --idx8-input-border: #cbd5e1;
    --idx8-radius: 1rem;
    --idx8-radius-sm: 0.75rem;
    --idx8-overlay: rgba(19, 0, 54, 0.75);

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

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

body {
    font-family: 'Raleway Regular', sans-serif;
    color: var(--idx8-text);
    min-height: 100vh;
}

/* Background */
.idx8-bg-wrap {
    position: fixed; inset: 0; z-index: 0;
    background-image: url(../img/bg.jpg);
    background-size: cover; background-position: center;
}
.idx8-bg-wrap::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(var(--idx8-primary-rgb),0.30) 0%, rgba(19,0,54,0.50) 100%);
}

/* Page Layout */
.idx8-page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

.idx8-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem; flex-shrink: 0;
}
.idx8-topbar .navbar-brand img {
    max-width: 180px; max-height: 45px; height: auto;
    object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    transition: transform 0.3s ease;
}
.idx8-topbar .navbar-brand img:hover { transform: scale(1.04); }
.idx8-topbar .navbar-brand img.customLogoClass { max-width: none; max-height: none; filter: none; }

/* Language */
.language-changer { position: relative; }
.language-changer > a {
    background: rgba(255,255,255,0.15); color: #fff;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    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: rgba(255,255,255,0.25); color: #fff;
}
.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(--idx8-border); border-radius: var(--idx8-radius-sm);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); padding: 0.5rem 0; background: #fff;
}
.country-wrap .dropdown-item { padding: 0.5rem 1rem; font-size: 0.9rem; color: var(--idx8-text); }
.country-wrap .dropdown-item:hover { background: rgba(var(--idx8-primary-rgb),0.06); }

/* Content */
.idx8-content {
    flex: 1; display: flex; align-items: flex-start; justify-content: center;
    padding: 0 2rem 2rem;
}
.idx8-content > .idx8-main-card { margin: auto 0; }

/* Main Card */
.idx8-main-card {
    background: #fff; border-radius: 1.5rem;
    box-shadow: 0 25px 80px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.08) inset;
    overflow: hidden; width: 100%; max-width: 960px;
    animation: idx8CardIn 0.6s ease-out 0.1s both;
}
@keyframes idx8CardIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Description Pane — Photo BG with Overlay */
.idx8-desc-pane {
    background-image: url(../img/bg-photo.jpg);
    background-size: cover; background-position: center;
    color: #fff; position: relative; overflow: hidden;
    display: flex; align-items: center; padding: 2.5rem;
}
.idx8-desc-pane::before {
    content: ''; position: absolute; inset: 0;
    background: var(--idx8-overlay);
    z-index: 1;
}
.idx8-desc-inner {
    position: relative; z-index: 2;
    max-height: 65vh; overflow-y: auto; padding-right: 0.5rem;
}
.idx8-desc-inner h1, .idx8-desc-inner h2, .idx8-desc-inner h3,
.idx8-desc-inner h4, .idx8-desc-inner h5, .idx8-desc-inner h6 {
    font-family: 'Raleway Black', sans-serif; color: #fff;
}
.idx8-desc-inner p { color: rgba(255,255,255,0.82); font-size: 0.95rem; line-height: 1.7; }
.idx8-desc-inner a { color: var(--idx8-primary-light); }
.idx8-desc-inner::-webkit-scrollbar { width: 4px; }
.idx8-desc-inner::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.idx8-desc-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.idx8-desc-logo { margin-bottom: 1.25rem; }
.idx8-desc-logo img {
    max-width: 160px; max-height: 45px; height: auto;
    object-fit: contain; filter: brightness(0) invert(1); opacity: 0.9;
}

/* Decorative glow */
.idx8-desc-glow {
    position: absolute; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(var(--idx8-primary-rgb),0.2) 0%, transparent 70%);
    border-radius: 50%; z-index: 1;
    top: -80px; right: -80px;
}

/* Form Pane */
.idx8-form-pane {
    display: flex; align-items: flex-start; justify-content: center;
    padding: 2.5rem; overflow-y: auto;
}
.idx8-form-wrapper { width: 100%; max-width: 400px; margin: auto 0; }

/* Tab Navigation */
.idx8-tabs {
    display: flex; border-bottom: 2px solid var(--idx8-border); margin-bottom: 1.5rem;
}
.idx8-tab {
    flex: 1; text-align: center; padding: 0.75rem 1rem;
    font-family: 'Raleway Bold', sans-serif; font-size: 0.95rem; font-weight: 700;
    color: var(--idx8-text-light); text-decoration: none;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: all 0.3s ease;
}
.idx8-tab:hover { color: var(--idx8-text-muted); }
.idx8-tab.active {
    color: var(--idx8-primary); border-bottom-color: var(--idx8-primary);
}

/* Header Icon */
.idx8-header-icon {
    width: 54px; height: 54px; border-radius: 0.875rem;
    background: linear-gradient(135deg, var(--idx8-primary), var(--idx8-primary-dark));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 6px 20px rgba(var(--idx8-primary-rgb),0.3);
    animation: idx8IconPulse 3s ease-in-out infinite;
}
.idx8-header-icon i { font-size: 1.4rem; color: #fff; }
@keyframes idx8IconPulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(var(--idx8-primary-rgb),0.3); }
    50% { box-shadow: 0 6px 28px rgba(var(--idx8-primary-rgb),0.5); }
}

.idx8-title {
    font-family: 'Raleway Black', sans-serif;
    font-size: 1.5rem; font-weight: 900; color: var(--idx8-text);
    text-align: center; margin-bottom: 0.25rem; text-transform: uppercase;
    letter-spacing: 0.03em;
}
.idx8-subtitle { color: var(--idx8-text-muted); font-size: 0.88rem; text-align: center; }

/* Inputs */
.idx8-input-group { position: relative; }
.idx8-input {
    background: var(--idx8-input-bg) !important;
    border: 1.5px solid var(--idx8-input-border) !important;
    border-radius: var(--idx8-radius-sm) !important;
    color: var(--idx8-text) !important;
    height: 54px; font-size: 0.95rem;
    transition: all 0.3s ease; padding-right: 3rem;
}
.idx8-input::placeholder { color: transparent; }
.idx8-input:focus {
    background: #fff !important;
    border-color: var(--idx8-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--idx8-primary-rgb),0.1), 0 4px 16px rgba(var(--idx8-primary-rgb),0.06) !important;
}
.idx8-input-group label { color: var(--idx8-text-muted); font-size: 0.9rem; }
.idx8-input-group .form-control:focus ~ label,
.idx8-input-group .form-control:not(:placeholder-shown) ~ label { color: var(--idx8-primary); }

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

/* Buttons */
.idx8-btn-primary {
    background: linear-gradient(135deg, var(--idx8-primary), var(--idx8-primary-dark));
    border: none; color: #fff;
    border-radius: var(--idx8-radius-sm); font-size: 1rem; font-weight: 700;
    font-family: 'Raleway Bold', sans-serif;
    position: relative; overflow: hidden;
    transition: all 0.35s ease;
    box-shadow: 0 4px 15px rgba(var(--idx8-primary-rgb),0.3);
}
.idx8-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;
}
.idx8-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--idx8-primary-rgb),0.4); color: #fff;
}
.idx8-btn-primary:hover::before { left: 100%; }

.idx8-btn-outline {
    background: transparent; border: 1.5px solid var(--idx8-border);
    color: var(--idx8-text-muted); border-radius: var(--idx8-radius-sm);
    font-size: 0.95rem; font-weight: 600; transition: all 0.3s ease;
}
.idx8-btn-outline:hover {
    background: rgba(var(--idx8-primary-rgb),0.04); border-color: var(--idx8-primary);
    color: var(--idx8-primary); transform: translateY(-1px);
}

/* Links */
.idx8-link {
    color: var(--idx8-primary); text-decoration: none; font-weight: 600;
    font-size: 0.85rem; transition: color 0.3s ease; position: relative; padding-bottom: 2px;
}
.idx8-link::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: linear-gradient(90deg, var(--idx8-primary), var(--idx8-primary-light));
    transition: width 0.3s ease; border-radius: 1px;
}
.idx8-link:hover { color: var(--idx8-primary-dark); }
.idx8-link:hover::after { width: 100%; }

/* Info Banner */
.idx8-info-banner {
    background: linear-gradient(135deg, rgba(var(--idx8-primary-rgb),0.05), rgba(var(--idx8-accent-rgb),0.03));
    border: 1px solid rgba(var(--idx8-primary-rgb),0.1);
    border-left: 3px solid var(--idx8-primary);
    border-radius: var(--idx8-radius-sm); padding: 0.85rem 1rem;
}
.idx8-info-banner i { color: var(--idx8-primary); }
.idx8-info-banner p { color: var(--idx8-text-muted); font-size: 0.82rem; line-height: 1.5; margin: 0; }

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

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

/* Registration Overrides */
.idx8-register-container .form-control,
.idx8-register-container .form-select {
    background: var(--idx8-input-bg); border: 1.5px solid var(--idx8-input-border);
    border-radius: var(--idx8-radius-sm); transition: all 0.3s ease;
}
.idx8-register-container .form-control:focus,
.idx8-register-container .form-select:focus {
    background: #fff; border-color: var(--idx8-primary);
    box-shadow: 0 0 0 3px rgba(var(--idx8-primary-rgb),0.1);
}
.idx8-register-container label { color: var(--idx8-text-muted); font-size: 0.875rem; font-weight: 500; }
.idx8-register-container .btn-primary {
    background: linear-gradient(135deg, var(--idx8-primary), var(--idx8-primary-dark));
    border: none; border-radius: var(--idx8-radius-sm);
    box-shadow: 0 4px 15px rgba(var(--idx8-primary-rgb),0.3);
    font-weight: 700; transition: all 0.35s ease;
}
.idx8-register-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--idx8-primary-rgb),0.4);
}
.idx8-register-container .form-check-input:checked { background-color: var(--idx8-primary); border-color: var(--idx8-primary); }
.idx8-register-container a { color: var(--idx8-primary); font-weight: 600; }

/* Footer */
.idx8-footer {
    background: rgba(15, 10, 30, 0.88);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: 0.6rem 0; flex-shrink: 0; z-index: 1040;
}
.idx8-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;
}
.idx8-footer .nav-link:hover { color: #fff !important; background: rgba(255,255,255,0.08); }
.idx8-footer .navbar-toggler-icon { filter: invert(1); }
.idx8-footer-text { color: rgba(255,255,255,0.35); font-size: 0.78rem; }

/* Animations */
@keyframes idx8FadeInUp {
    0% { opacity: 0; transform: translateY(18px); }
    100% { opacity: 1; transform: translateY(0); }
}
.idx8-stagger-1 { animation: idx8FadeInUp 0.5s ease-out 0.1s both; }
.idx8-stagger-2 { animation: idx8FadeInUp 0.5s ease-out 0.2s both; }
.idx8-stagger-3 { animation: idx8FadeInUp 0.5s ease-out 0.3s both; }
.idx8-stagger-4 { animation: idx8FadeInUp 0.5s ease-out 0.4s both; }
.idx8-stagger-5 { animation: idx8FadeInUp 0.5s ease-out 0.5s both; }
.idx8-stagger-6 { animation: idx8FadeInUp 0.5s ease-out 0.6s both; }

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

/* Common CSS overrides */
[data-type="login"] { display: none; }
.reg-agree-label { display: block; }
form.reg_form > legend { display: none; }
form.reg_form label { display: none; }
form.reg_form label.reg-agree-label,
form.reg_form label.aff-check-label { display: block !important; }
.btn-registration { display: block; width: 100%; }

.btn-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn-loading:after {
    content: ''; animation: idx8Loader 500ms infinite linear;
    border: 2px solid #fff; border-radius: 50%;
    border-right-color: transparent !important; border-top-color: transparent !important;
    display: block; height: 1.4em; width: 1.4em;
    position: absolute; left: calc(50% - 0.7em); top: calc(50% - 0.7em);
}
@keyframes idx8Loader { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 991.98px) {
    .idx8-topbar { padding: 0.85rem 1.25rem; }
    .idx8-content { padding: 0 1rem 1.5rem; }
    .idx8-main-card { max-width: 100%; }
    .idx8-desc-pane { padding: 2rem 1.5rem; min-height: auto; }
    .idx8-form-pane { padding: 2rem 1.5rem; }
    .idx8-desc-inner { max-height: none; }
}
@media (max-width: 575.98px) {
    .idx8-title { font-size: 1.25rem; }
    .idx8-form-pane { padding: 1.5rem 1.25rem; }
    .idx8-desc-pane { padding: 1.5rem 1.25rem; }
}

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

/* ============================================================
   DARK MODE
   ============================================================ */
[data-bs-theme="dark"] {
    --idx8-text: #e2e8f0;
    --idx8-text-muted: #94a3b8;
    --idx8-text-light: #64748b;
    --idx8-border: rgba(255,255,255,0.08);
    --idx8-input-bg: #161926;
    --idx8-input-border: rgba(255,255,255,0.1);
    --idx8-overlay: rgba(10, 0, 30, 0.85);
    --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 {
    color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] a:not(.btn) {
    color: #93c5fd;
}

/* Index8-specific dark overrides */
[data-bs-theme="dark"] .idx8-main-card {
    background: #1a1d2e;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04) inset;
}
[data-bs-theme="dark"] .idx8-form-pane {
    background: #1a1d2e;
}
[data-bs-theme="dark"] .idx8-desc-pane::before {
    background: rgba(10, 0, 30, 0.88);
}
[data-bs-theme="dark"] .idx8-tabs {
    border-bottom-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .idx8-tab {
    color: #64748b;
}
[data-bs-theme="dark"] .idx8-tab:hover {
    color: #94a3b8;
}
[data-bs-theme="dark"] .idx8-tab.active {
    color: var(--idx8-primary-light);
    border-bottom-color: var(--idx8-primary-light);
}
[data-bs-theme="dark"] .idx8-title {
    color: #f1f5f9;
}
[data-bs-theme="dark"] .idx8-subtitle {
    color: #94a3b8;
}
[data-bs-theme="dark"] .idx8-btn-outline {
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
}
[data-bs-theme="dark"] .idx8-btn-outline:hover {
    background: rgba(var(--idx8-primary-rgb),0.08);
    border-color: var(--idx8-primary);
    color: var(--idx8-primary);
}
[data-bs-theme="dark"] .idx8-input:focus {
    background: #1e2235 !important;
}
[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.08);
}
[data-bs-theme="dark"] .country-wrap .dropdown-item {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .country-wrap .dropdown-item:hover {
    background: rgba(var(--idx8-primary-rgb),0.1);
}
[data-bs-theme="dark"] .idx8-info-banner {
    background: linear-gradient(135deg, rgba(var(--idx8-primary-rgb),0.08), rgba(var(--idx8-accent-rgb),0.05));
    border-color: rgba(var(--idx8-primary-rgb),0.15);
}
[data-bs-theme="dark"] .idx8-trust-footer {
    border-top-color: rgba(255,255,255,0.08);
    color: #64748b;
}
[data-bs-theme="dark"] .idx8-register-container .form-control:focus,
[data-bs-theme="dark"] .idx8-register-container .form-select:focus {
    background: #1a1d2e;
}
[data-bs-theme="dark"] .idx8-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);
}
