html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background: #0f141b !important;
  color: #e8edf6 !important;
}

html[data-theme="dark"] nav,
html[data-theme="dark"] .main,
html[data-theme="dark"] main,
html[data-theme="dark"] #contact .contact-modal,
html[data-theme="dark"] .existing-user-modal,
html[data-theme="dark"] .overlay .modal,
html[data-theme="dark"] .modal2,
html[data-theme="dark"] .unique-err-card,
html[data-theme="dark"] .location,
html[data-theme="dark"] .overlay .center {
  background: #171d26 !important;
  color: #e8edf6 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .modal-header {
  background: linear-gradient(180deg, #1d6f5c 0%, #145447 100%) !important;
}

html[data-theme="dark"] .info-text,
html[data-theme="dark"] .err-alert,
html[data-theme="dark"] .location-grid .location:has([type=radio]:checked) {
  background: #1d2632 !important;
  color: #d8e0ef !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .err-main-text,
html[data-theme="dark"] .existing-user-modal .form-group label,
html[data-theme="dark"] .modal-link-btn,
html[data-theme="dark"] .main p,
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] label,
html[data-theme="dark"] .action,
html[data-theme="dark"] .password {
  color: #d8e0ef !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .existing-user-modal .form-group input[type=email],
html[data-theme="dark"] .existing-user-modal .form-group input[type=password],
html[data-theme="dark"] .modal2 input {
  background: #1e2632 !important;
  color: #edf3fb !important;
  border-color: #42526a !important;
}

html[data-theme="dark"] input[readonly] {
  background: #232d3b !important;
  color: #9aa7bb !important;
}

html[data-theme="dark"] .modal-btn-primary,
html[data-theme="dark"] .modal-link-btn:hover,
html[data-theme="dark"] .radio-toolbar label,
html[data-theme="dark"] .grid-tripes + .center button,
html[data-theme="dark"] .modal2 button {
  background: #243040 !important;
  color: #edf3fb !important;
  border-color: #42526a !important;
}

html[data-theme="dark"] .modal-close,
html[data-theme="dark"] span.x {
  background: #232d3b !important;
  color: #d8e0ef !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] a,
html[data-theme="dark"] .err-login-btn {
  color: #9be57d !important;
}

html[data-theme="dark"] .err-icon {
  background: rgba(76, 141, 112, 0.2) !important;
  color: #8bd86d !important;
}

html[data-theme="dark"] .overlay,
html[data-theme="dark"] .modal-overlay {
  background: rgba(5, 8, 12, 0.78) !important;
}

/* Server cards dark mode */
html[data-theme="dark"] .server-card {
  background: #1e2632 !important;
  border-color: #42526a !important;
  color: #e8edf6 !important;
}
html[data-theme="dark"] .server-card:hover:not(.server-full) {
  border-color: #9be57d !important;
}
html[data-theme="dark"] .server-active {
  background: #1a2e1a !important;
  border-color: #9be57d !important;
  box-shadow: 0 0 0 1px #9be57d !important;
}
html[data-theme="dark"] .server-full {
  background: #1a1a1a !important;
}
html[data-theme="dark"] .server-number {
  color: #e8edf6 !important;
}
html[data-theme="dark"] .server-card-info,
html[data-theme="dark"] .server-card-date {
  color: #9aa7bb !important;
}
html[data-theme="dark"] .status-open {
  background: #1a3a1a !important;
  color: #9be57d !important;
}
html[data-theme="dark"] .status-full {
  background: #3a1a1a !important;
  color: #ff8888 !important;
}

/* ═══ Register Wizard — Dark Mode ═══ */

/* Title */
html[data-theme="dark"] .main-form h1.title { color: #e8edf6 !important; }

/* Step indicator */
html[data-theme="dark"] .step-dot { background: #2a3545 !important; }
html[data-theme="dark"] .step-dot.active { background: #71d000 !important; }
html[data-theme="dark"] .step-dot.done { background: #71d000 !important; }
html[data-theme="dark"] .step-text { color: #9aa7bb !important; }

/* Section headings */
html[data-theme="dark"] .sec-heading { color: #e8edf6 !important; }
html[data-theme="dark"] .sec-sub { color: #7a8999 !important; }
html[data-theme="dark"] .sub-label { color: #c8d2e0 !important; }

/* Section groups */
html[data-theme="dark"] .section-group {
  background: #1a2230 !important;
  border-color: #2a3545 !important;
}
html[data-theme="dark"] .selection-divider::before {
  background: linear-gradient(to bottom, rgba(113,208,0,0), rgba(113,208,0,0.35), rgba(113,208,0,0)) !important;
}
html[data-theme="dark"] .selection-divider-dot {
  background: #171d26 !important;
  border-color: #71d000 !important;
  box-shadow: 0 0 0 6px rgba(113,208,0,0.14) !important;
}

/* Tribe rows */
html[data-theme="dark"] .tribe-row {
  background: #1e2632 !important;
  border-color: #2a3545 !important;
}
html[data-theme="dark"] .tribe-row:hover {
  border-color: #3d5a3a !important;
  background: #1a2a1f !important;
}
html[data-theme="dark"] .tribe-row.selected {
  border-color: #3d7a30 !important;
  background: #1a2e1a !important;
}
html[data-theme="dark"] .t-radio { border-color: #42526a !important; background: #1e2632 !important; }
html[data-theme="dark"] .tribe-row.selected .t-radio { border-color: #71d000 !important; background: #71d000 !important; }
html[data-theme="dark"] .t-name { color: #d8e0ef !important; }
html[data-theme="dark"] .tribe-row.selected .t-name { color: #c8efc0 !important; }
html[data-theme="dark"] .t-desc { color: #7a8999 !important; }
html[data-theme="dark"] .t-info-btn { background: #1e2632 !important; border-color: #2a3545 !important; color: #7a8999 !important; }
html[data-theme="dark"] .t-info-btn:hover { border-color: #71d000 !important; color: #71d000 !important; background: #1a2e1a !important; }

/* Tribe modal */
html[data-theme="dark"] .tribe-modal-overlay { background: rgba(5,8,12,0.78) !important; }
html[data-theme="dark"] .tribe-modal { background: #171d26 !important; box-shadow: 0 12px 40px rgba(0,0,0,0.4) !important; }
html[data-theme="dark"] .tm-head { border-bottom-color: #2a3545 !important; }
html[data-theme="dark"] .tm-head h3 { color: #e8edf6 !important; }
html[data-theme="dark"] .tm-close { background: #1e2632 !important; color: #9aa7bb !important; }
html[data-theme="dark"] .tm-close:hover { background: #2a1215 !important; color: #ff8888 !important; }
html[data-theme="dark"] .tm-row { border-top-color: #2a3545 !important; }
html[data-theme="dark"] .tm-label { color: #7a8999 !important; }
html[data-theme="dark"] .tm-stars .off { color: #2a3545 !important; }
html[data-theme="dark"] .tm-val { color: #e8edf6 !important; }
html[data-theme="dark"] .tm-best { background: #1a2e1a !important; color: #9be57d !important; }

/* Location */
html[data-theme="dark"] .loc-default { background: #1e2632 !important; border-color: #2a3545 !important; }
html[data-theme="dark"] .loc-default:hover { border-color: #3d5a3a !important; background: #1a2a1f !important; }
html[data-theme="dark"] .loc-default.selected { border-color: #3d7a30 !important; background: #1a2e1a !important; }
html[data-theme="dark"] .loc-default .lr { border-color: #42526a !important; background: #1e2632 !important; }
html[data-theme="dark"] .loc-default.selected .lr { border-color: #71d000 !important; background: #71d000 !important; }
html[data-theme="dark"] .loc-default-text { color: #d8e0ef !important; }
html[data-theme="dark"] .loc-default.selected .loc-default-text { color: #c8efc0 !important; }
html[data-theme="dark"] .loc-default-hint { color: #7a8999 !important; }
html[data-theme="dark"] .loc-dir { background: #1e2632 !important; border-color: #2a3545 !important; color: #9aa7bb !important; }
html[data-theme="dark"] .loc-dir:hover { border-color: #3d5a3a !important; background: #1a2a1f !important; }
html[data-theme="dark"] .loc-dir.selected { border-color: #3d7a30 !important; background: #1a2e1a !important; color: #c8efc0 !important; }

/* Form fields */
html[data-theme="dark"] .field label { color: #9aa7bb !important; }
html[data-theme="dark"] .field-hint { color: #7a8999 !important; }
html[data-theme="dark"] .field input[type="text"],
html[data-theme="dark"] .field input[type="email"],
html[data-theme="dark"] .field input[type="password"],
html[data-theme="dark"] .field input[type="tel"] {
  background: #1e2632 !important;
  color: #edf3fb !important;
  border-color: #42526a !important;
}
html[data-theme="dark"] .field input:focus {
  border-color: #9be57d !important;
  box-shadow: 0 0 0 3px rgba(155,229,125,0.1) !important;
  background: #232d3b !important;
}
html[data-theme="dark"] .field input::placeholder { color: #566a84 !important; }

/* Password strength */
html[data-theme="dark"] .pw-eye:hover { opacity: 0.8 !important; }
html[data-theme="dark"] .pw-b { background: #2a3545 !important; }
html[data-theme="dark"] .pw-b.on { background: #e6a817 !important; }
html[data-theme="dark"] .pw-b.on.ok { background: #71d000 !important; }
html[data-theme="dark"] .pw-label { color: #7a8999 !important; }
html[data-theme="dark"] .pass-rules-label { color: #9aa7bb !important; }
html[data-theme="dark"] .pass-rules-label::before {
  background: linear-gradient(to left, #71d000, #355022) !important;
}

/* Mode toggle */
html[data-theme="dark"] .m-btn { background: #1e2632 !important; border-color: #2a3545 !important; color: #9aa7bb !important; }
html[data-theme="dark"] .m-btn:hover { color: #d8e0ef !important; background: #232d3b !important; }
html[data-theme="dark"] .m-btn.active { background: #71d000 !important; color: #fff !important; border-color: #71d000 !important; }

/* Buttons */
html[data-theme="dark"] .btn-silver {
  background: linear-gradient(to bottom, #2a3545, #1e2632) !important;
  border-color: #42526a !important;
  color: #edf3fb !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 1px 2px rgba(0,0,0,0.3) !important;
}
html[data-theme="dark"] .btn-silver:hover {
  background: linear-gradient(to bottom, #32404f, #243040) !important;
  border-color: #566a84 !important;
}
html[data-theme="dark"] .btn-silver:disabled {
  background: #3a4556 !important;
  color: #7a8999 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .btn-ghost {
  background: #1e2632 !important;
  border-color: #42526a !important;
  color: #9aa7bb !important;
}
html[data-theme="dark"] .btn-ghost:hover { background: #232d3b !important; border-color: #566a84 !important; color: #d8e0ef !important; }

/* Step actions */
html[data-theme="dark"] .step-actions-split { border-top-color: #2a3545 !important; }
html[data-theme="dark"] .step-actions-split .summary { color: #7a8999 !important; }
html[data-theme="dark"] .step-actions-split .summary b { color: #c8d2e0 !important; }

/* Phone/OTP */
html[data-theme="dark"] .phone-prefix {
  background: #232d3b !important;
  border-color: #42526a !important;
  color: #e8edf6 !important;
}
html[data-theme="dark"] .inline-status { color: #9aa7bb !important; }
html[data-theme="dark"] .inline-status.is-success { color: #9be57d !important; }
html[data-theme="dark"] .inline-status.is-error { color: #ff8888 !important; }
html[data-theme="dark"] .otp-timer { color: #9aa7bb !important; }
html[data-theme="dark"] .otp-btn { background: #29621d !important; }
html[data-theme="dark"] .otp-btn:hover:not(:disabled) { background: #1e4a15 !important; }
html[data-theme="dark"] .otp-btn:disabled { background: #3a4556 !important; color: #7a8999 !important; }
html[data-theme="dark"] .otp-verified { color: #9be57d !important; }
html[data-theme="dark"] .otp-modal-overlay { background: rgba(5,8,12,0.78) !important; }
html[data-theme="dark"] .otp-modal {
  background: #171d26 !important;
  border-color: #2a3545 !important;
  box-shadow: 0 18px 48px rgba(0,0,0,0.45) !important;
}
html[data-theme="dark"] .otp-modal-close {
  background: #1e2632 !important;
  border-color: #2a3545 !important;
  color: #9aa7bb !important;
}
html[data-theme="dark"] .otp-modal-close:hover {
  background: #232d3b !important;
  border-color: #566a84 !important;
  color: #d8e0ef !important;
}
html[data-theme="dark"] .otp-modal-title { color: #e8edf6 !important; }
html[data-theme="dark"] .otp-modal-sub { color: #7a8999 !important; }

/* Errors */
html[data-theme="dark"] .err { background: #2a1215 !important; border-color: #5c2326 !important; color: #ff8888 !important; }
html[data-theme="dark"] .err a { color: #9be57d !important; }
html[data-theme="dark"] #error-summary { background: #2a1215 !important; border-color: #5c2326 !important; color: #ff8888 !important; }
html[data-theme="dark"] #pass-confirmation li {
  background: transparent !important;
  border-color: transparent !important;
  color: #9aa7bb !important;
}
html[data-theme="dark"] #pass-confirmation li::before {
  border-color: #566a84 !important;
  background: #171d26 !important;
  box-shadow: 0 0 0 4px #1a2230 !important;
}
html[data-theme="dark"] #pass-confirmation li.success {
  background: transparent !important;
  border-color: transparent !important;
  color: #9be57d !important;
}
html[data-theme="dark"] #pass-confirmation li.success::before {
  background: #71d000 !important;
  border-color: #71d000 !important;
  box-shadow: 0 0 0 4px rgba(113,208,0,0.18) !important;
}

/* Below form */
html[data-theme="dark"] .new-world-bar {
  background: linear-gradient(to left, #1a2230, #1a2a1f) !important;
  border-color: #2a3a2a !important;
  border-right-color: #3d7a30 !important;
}
html[data-theme="dark"] .new-world-bar:hover { background: linear-gradient(to left, #1e2632, #1e3423) !important; }
html[data-theme="dark"] .nw-text { color: #9be57d !important; }
html[data-theme="dark"] .nw-date { color: #7a8999 !important; }
html[data-theme="dark"] .sec-link { background: #1a2230 !important; border-color: #2a3545 !important; }
html[data-theme="dark"] .sec-link:hover { background: #1e2632 !important; border-color: #3a4556 !important; }
html[data-theme="dark"] .sec-link strong { color: #d8e0ef !important; }
html[data-theme="dark"] .sec-link span { color: #7a8999 !important; }
html[data-theme="dark"] .world-age { color: #566a84 !important; }

/* Alerts */
html[data-theme="dark"] .alert { background: #1a2230 !important; border-color: #2a3545 !important; color: #9aa7bb !important; }
html[data-theme="dark"] .alert2 { background: #2a1215 !important; border-color: #5c2326 !important; color: #ff8888 !important; }
html[data-theme="dark"] .alert2 a { color: #b89aff !important; }

/* Muted & status */
html[data-theme="dark"] .muted { color: #9aa7bb !important; }
html[data-theme="dark"] .selection-note { color: #7a8999 !important; }
html[data-theme="dark"] .field-valid { color: #9be57d !important; }
html[data-theme="dark"] .field-invalid { color: #ff8888 !important; }

/* Login: error containers */
html[data-theme="dark"] .error-container {
  background: #2a1215 !important;
  border-color: #5c2326 !important;
}
html[data-theme="dark"] .error-message {
  color: #ff8888 !important;
}
html[data-theme="dark"] .loader-overlay {
  background: rgba(15, 20, 27, 0.9) !important;
}
html[data-theme="dark"] #err-box {
  background: #2a1215 !important;
  border-color: #5c2326 !important;
}
html[data-theme="dark"] #err-box .err {
  color: #ff8888 !important;
}
html[data-theme="dark"] .err-alert {
  background: #2a1215 !important;
  border-color: #5c2326 !important;
  color: #ff8888 !important;
}
