/* ============================================================
   Theme Index5: "Deep Blue Overlay" — Full BG + Content Split
   Bootstrap 5 + Custom 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 {
    --idx5-primary: #2563eb;
    --idx5-primary-rgb: 37, 99, 235;
    --idx5-primary-light: #60a5fa;
    --idx5-primary-dark: #1d4ed8;
    --idx5-accent: #3b82f6;
    --idx5-accent-rgb: 59, 130, 246;
    --idx5-text: #1e293b;
    --idx5-text-muted: #64748b;
    --idx5-text-light: #94a3b8;
    --idx5-border: #e2e8f0;
    --idx5-input-bg: #f8fafc;
    --idx5-input-border: #cbd5e1;
    --idx5-radius: 1rem;
    --idx5-radius-sm: 0.75rem;
    --idx5-card-bg: rgba(255, 255, 255, 0.92);

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

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

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

/* --- Full-screen Background --- */
.idx5-bg-wrap {
    position: fixed; inset: 0; z-index: 0;
    background-image: url(../img/bg.png);
    background-size: cover; background-position: center;
    background-repeat: no-repeat;
}
.idx5-bg-wrap::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(var(--idx5-primary-rgb),0.40) 0%, rgba(30,27,75,0.55) 100%);
}

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

.idx5-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem; flex-shrink: 0;
}
.idx5-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.2));
    transition: transform 0.3s ease;
}
.idx5-topbar .navbar-brand img:hover { transform: scale(1.04); }
.idx5-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;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.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(--idx5-border); border-radius: var(--idx5-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(--idx5-text); }
.country-wrap .dropdown-item:hover { background: rgba(var(--idx5-primary-rgb),0.06); }

/* --- Content Area --- */
.idx5-content {
    flex: 1; display: flex; align-items: flex-start;
    padding: 1rem 2rem 2rem; overflow-y: auto;
}
.idx5-content > .idx5-row { margin: auto 0; }
.idx5-row { width: 100%; }

/* --- Form Card (Glass) --- */
.idx5-card {
    background: var(--idx5-card-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-radius: 1.25rem; border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 0 0 1px rgba(255,255,255,0.1) inset;
    padding: 2.5rem;
    max-width: 480px; margin: 0 auto;
}

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

@keyframes idx5IconPulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(var(--idx5-primary-rgb),0.3); }
    50% { box-shadow: 0 6px 28px rgba(var(--idx5-primary-rgb),0.5); }
}

.idx5-title {
    font-family: 'Raleway Black', sans-serif;
    font-size: 1.55rem; font-weight: 900; color: var(--idx5-text);
    margin-bottom: 0.25rem; letter-spacing: -0.02em;
}
.idx5-subtitle { color: var(--idx5-text-muted); font-size: 0.9rem; }

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

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

/* --- Buttons --- */
.idx5-btn-primary {
    background: linear-gradient(135deg, var(--idx5-primary), var(--idx5-primary-dark));
    background-size: 200% 200%; border: none; color: #fff;
    border-radius: 50px; 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(--idx5-primary-rgb),0.3);
}
.idx5-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;
}
.idx5-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--idx5-primary-rgb),0.4); color: #fff;
}
.idx5-btn-primary:hover::before { left: 100%; }
.idx5-btn-primary:active { transform: translateY(0); }

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

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

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

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

.idx5-signup-text { color: var(--idx5-text-muted); font-size: 0.875rem; }
.idx5-signup-text a { color: var(--idx5-primary); font-weight: 700; text-decoration: none; }
.idx5-signup-text a:hover { text-decoration: underline; }

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

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

/* --- Affiliate Description (Right Panel) --- */
.idx5-description-pane {
    color: #fff; display: flex; align-items: center; padding: 0 1.5rem;
}
.idx5-description-inner {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 1.25rem; border: 1px solid rgba(255,255,255,0.12);
    padding: 2rem; max-height: 75vh; overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.idx5-description-inner h1, .idx5-description-inner h2,
.idx5-description-inner h3, .idx5-description-inner h4,
.idx5-description-inner h5, .idx5-description-inner h6 {
    font-family: 'Raleway Black', sans-serif; color: #fff;
}
.idx5-description-inner p { color: rgba(255,255,255,0.85); font-size: 0.95rem; line-height: 1.7; }
.idx5-description-inner a { color: var(--idx5-accent); }
.idx5-description-inner::-webkit-scrollbar { width: 5px; }
.idx5-description-inner::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 3px; }
.idx5-description-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

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

/* --- Animations --- */
@keyframes idx5FadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
.idx5-stagger-1 { animation: idx5FadeInUp 0.5s ease-out 0.05s both; }
.idx5-stagger-2 { animation: idx5FadeInUp 0.5s ease-out 0.15s both; }
.idx5-stagger-3 { animation: idx5FadeInUp 0.5s ease-out 0.25s both; }
.idx5-stagger-4 { animation: idx5FadeInUp 0.5s ease-out 0.35s both; }
.idx5-stagger-5 { animation: idx5FadeInUp 0.5s ease-out 0.45s both; }
.idx5-stagger-6 { animation: idx5FadeInUp 0.5s ease-out 0.55s both; }

@keyframes idx5CardIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.idx5-card { animation: idx5CardIn 0.6s ease-out 0.1s 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: idx5Loader 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 idx5Loader { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 991.98px) {
    .idx5-topbar { padding: 0.85rem 1.25rem; }
    .idx5-content { padding: 1rem 1.25rem; flex-direction: column; }
    .idx5-card { max-width: 100%; padding: 2rem 1.5rem; }
    .idx5-description-pane { padding: 1rem 0; }
    .idx5-description-inner { max-height: none; }
}
@media (max-width: 575.98px) {
    .idx5-title { font-size: 1.3rem; }
    .idx5-header-icon { width: 48px; height: 48px; }
    .idx5-header-icon i { font-size: 1.2rem; }
    .idx5-card { padding: 1.5rem 1.25rem; }
}

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

/* ============================================================
   DARK MODE
   ============================================================ */
[data-bs-theme="dark"] {
    --idx5-text: #e2e8f0;
    --idx5-text-muted: #94a3b8;
    --idx5-text-light: #64748b;
    --idx5-border: rgba(255,255,255,0.08);
    --idx5-input-bg: #161926;
    --idx5-input-border: rgba(255,255,255,0.1);
    --idx5-card-bg: rgba(26,29,46,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: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;
}

/* Index5-specific dark overrides */
[data-bs-theme="dark"] .idx5-card {
    background: rgba(26,29,46,0.85);
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .idx5-bg-wrap::after {
    background: linear-gradient(135deg, rgba(var(--idx5-primary-rgb),0.25) 0%, rgba(15,17,23,0.75) 100%);
}
[data-bs-theme="dark"] .idx5-input:focus {
    background: #1e2235 !important;
}
[data-bs-theme="dark"] .idx5-btn-outline {
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
}
[data-bs-theme="dark"] .idx5-btn-outline:hover {
    background: rgba(var(--idx5-primary-rgb),0.08);
    border-color: var(--idx5-primary);
    color: var(--idx5-primary);
}
[data-bs-theme="dark"] .language-changer > a {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    border-color: rgba(255,255,255,0.12);
}
[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(--idx5-primary-rgb),0.1);
}
[data-bs-theme="dark"] .idx5-info-banner {
    background: linear-gradient(135deg, rgba(var(--idx5-primary-rgb),0.08), rgba(var(--idx5-accent-rgb),0.05));
    border-color: rgba(var(--idx5-primary-rgb),0.15);
}
[data-bs-theme="dark"] .idx5-trust-footer {
    border-top-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .idx5-description-inner {
    background: rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.08);
}
[data-bs-theme="dark"] .idx5-register-container .form-control:focus,
[data-bs-theme="dark"] .idx5-register-container .form-select:focus {
    background: #1e2235 !important;
}
[data-bs-theme="dark"] .idx5-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);
}
