/* Xylo Trade — Auth pages light/dark theme (v1) */
html.auth-html {
  --auth-radius: 16px;
  --auth-radius-sm: 10px;
  --auth-gap: 28px;
  --auth-accent: var(--base-hex, #1B9A1C);
  --auth-accent-soft: color-mix(in srgb, var(--auth-accent) 18%, transparent);
  --auth-font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html[data-theme="light"].auth-html,
html.auth-html[data-theme="light"] {
  color-scheme: light;
  --auth-page-bg: radial-gradient(1200px 600px at 10% -10%, #e8f6ea 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e8eef8 0%, transparent 50%),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  --auth-panel-bg: #ffffff;
  --auth-panel-border: rgba(15, 23, 42, 0.08);
  --auth-panel-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --auth-panel-text: #0f172a;
  --auth-panel-muted: #64748b;
  --auth-input-bg: #f8fafc;
  --auth-input-bg-focus: #ffffff;
  --auth-input-border: #d0d7e2;
  --auth-input-border-focus: var(--auth-accent);
  --auth-input-text: #0f172a;
  --auth-input-placeholder: #94a3b8;
  --auth-link: var(--auth-accent);
  --auth-link-hover: #0f172a;
  --auth-carousel-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  --auth-toggle-bg: rgba(15, 23, 42, 0.06);
  --auth-toggle-border: rgba(15, 23, 42, 0.1);
  --auth-cookie-bg: #ffffff;
}

html[data-theme="dark"].auth-html,
html.auth-html[data-theme="dark"] {
  color-scheme: dark;
  --auth-page-bg: radial-gradient(1000px 500px at 0% 0%, rgba(27, 154, 28, 0.18) 0%, transparent 55%),
    radial-gradient(800px 480px at 100% 10%, rgba(56, 120, 255, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #0b1220 0%, #070b14 100%);
  --auth-panel-bg: rgba(15, 23, 42, 0.72);
  --auth-panel-border: rgba(255, 255, 255, 0.1);
  --auth-panel-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  --auth-panel-text: #f8fafc;
  --auth-panel-muted: rgba(248, 250, 252, 0.68);
  --auth-input-bg: rgba(2, 6, 23, 0.55);
  --auth-input-bg-focus: rgba(2, 6, 23, 0.8);
  --auth-input-border: rgba(255, 255, 255, 0.14);
  --auth-input-border-focus: var(--auth-accent);
  --auth-input-text: #f8fafc;
  --auth-input-placeholder: rgba(248, 250, 252, 0.4);
  --auth-link: #4ade80;
  --auth-link-hover: #ffffff;
  --auth-carousel-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --auth-toggle-bg: rgba(255, 255, 255, 0.08);
  --auth-toggle-border: rgba(255, 255, 255, 0.12);
  --auth-cookie-bg: rgba(15, 23, 42, 0.92);
}

body.auth-themed-page {
  background: var(--auth-page-bg) !important;
  color: var(--auth-panel-text) !important;
  min-height: 100vh;
  font-family: var(--auth-font);
}

/* Theme toggle */
.auth-theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--auth-toggle-border);
  background: var(--auth-toggle-bg);
  color: var(--auth-panel-text);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.2s ease;
}

.auth-theme-toggle:hover {
  transform: translateY(-1px);
}

.auth-theme-toggle i {
  font-size: 16px;
  color: var(--auth-accent);
}

/* Layout */
.auth-account-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  padding: 48px 0 40px;
}

.auth-account-section .container {
  max-width: 1120px;
}

.auth-account-section .account-wrapper,
.auth-account-section .account-area,
.auth-account-section .signup-area,
.auth-account-section .login-area {
  background: transparent !important;
  box-shadow: none !important;
}

/* Form panel — beat main.css .common-form-style / .bg-one */
body.auth-themed-page .auth-form-panel,
body.auth-themed-page .common-form-style.auth-form-panel,
body.auth-themed-page .common-form-style.bg-one {
  background: var(--auth-panel-bg) !important;
  background-color: var(--auth-panel-bg) !important;
  color: var(--auth-panel-text) !important;
  border: 1px solid var(--auth-panel-border) !important;
  border-radius: var(--auth-radius) !important;
  box-shadow: var(--auth-panel-shadow) !important;
  backdrop-filter: blur(14px);
  padding: 36px 32px !important;
  text-align: left !important;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

body.auth-themed-page .auth-form-panel.create-account {
  max-width: 680px;
}

body.auth-themed-page .auth-form-panel .title,
body.auth-themed-page .auth-form-panel h4,
body.auth-themed-page .auth-form-panel label,
body.auth-themed-page .auth-form-panel .form-label {
  color: var(--auth-panel-text) !important;
}

body.auth-themed-page .auth-form-panel .title {
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px !important;
}

body.auth-themed-page .auth-form-panel > p,
body.auth-themed-page .auth-form-panel .mb-sm-4,
body.auth-themed-page .auth-form-panel .form-check-label,
body.auth-themed-page .auth-form-panel span:not(.input-group-text):not(.mobile-code) {
  color: var(--auth-panel-muted) !important;
}

body.auth-themed-page .auth-form-panel a.auth-link-accent {
  color: var(--auth-link) !important;
  text-decoration: none;
  font-weight: 600;
}

body.auth-themed-page .auth-form-panel a.auth-link-accent:hover {
  color: var(--auth-link-hover) !important;
  text-decoration: underline;
}

/* Inputs — override hardcoded #fff from main.css (direct theme colors; vars were sticky in some browsers) */
body.auth-themed-page .auth-form-panel .create-account-form .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.auth-themed-page .auth-form-panel .create-account-form .form-group select,
body.auth-themed-page .auth-form-panel .create-account-form .form-group textarea,
body.auth-themed-page .auth-form-panel input.form-control,
body.auth-themed-page .auth-form-panel select.form-control,
body.auth-themed-page .auth-form-panel textarea.form-control,
body.auth-themed-page .auth-form-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
body.auth-themed-page .auth-form-panel select,
body.auth-themed-page .auth-form-panel textarea {
  border: 1px solid var(--auth-input-border) !important;
  border-radius: var(--auth-radius-sm) !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 10px 14px !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

html[data-theme="light"] body.auth-themed-page .auth-form-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
html[data-theme="light"] body.auth-themed-page .auth-form-panel select,
html[data-theme="light"] body.auth-themed-page .auth-form-panel textarea,
html[data-theme="light"] body.auth-themed-page .auth-form-panel .form-control {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html[data-theme="dark"] body.auth-themed-page .auth-form-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
html[data-theme="dark"] body.auth-themed-page .auth-form-panel select,
html[data-theme="dark"] body.auth-themed-page .auth-form-panel textarea,
html[data-theme="dark"] body.auth-themed-page .auth-form-panel .form-control {
  background: rgba(2, 6, 23, 0.72) !important;
  background-color: rgba(2, 6, 23, 0.72) !important;
  color: #f8fafc !important;
}

body.auth-themed-page .auth-form-panel input::placeholder,
body.auth-themed-page .auth-form-panel textarea::placeholder {
  color: var(--auth-input-placeholder) !important;
  opacity: 1;
}

body.auth-themed-page .auth-form-panel input:focus,
body.auth-themed-page .auth-form-panel select:focus,
body.auth-themed-page .auth-form-panel textarea:focus,
body.auth-themed-page .auth-form-panel .form-control:focus {
  border-color: var(--auth-input-border-focus) !important;
  box-shadow: 0 0 0 3px var(--auth-accent-soft) !important;
  outline: none !important;
}

html[data-theme="light"] body.auth-themed-page .auth-form-panel input:focus,
html[data-theme="light"] body.auth-themed-page .auth-form-panel select:focus,
html[data-theme="light"] body.auth-themed-page .auth-form-panel textarea:focus {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="dark"] body.auth-themed-page .auth-form-panel input:focus,
html[data-theme="dark"] body.auth-themed-page .auth-form-panel select:focus,
html[data-theme="dark"] body.auth-themed-page .auth-form-panel textarea:focus {
  background: rgba(2, 6, 23, 0.9) !important;
  color: #f8fafc !important;
}

/* Autofill */
html[data-theme="light"] body.auth-themed-page .auth-form-panel input:-webkit-autofill,
html[data-theme="light"] body.auth-themed-page .auth-form-panel input:-webkit-autofill:hover,
html[data-theme="light"] body.auth-themed-page .auth-form-panel input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0 1000px #f8fafc inset !important;
  border: 1px solid var(--auth-input-border) !important;
}

html[data-theme="dark"] body.auth-themed-page .auth-form-panel input:-webkit-autofill,
html[data-theme="dark"] body.auth-themed-page .auth-form-panel input:-webkit-autofill:hover,
html[data-theme="dark"] body.auth-themed-page .auth-form-panel input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc;
  transition: background-color 9999s ease-in-out 0s;
  box-shadow: 0 0 0 1000px rgba(2, 6, 23, 0.72) inset !important;
  border: 1px solid var(--auth-input-border) !important;
}

html[data-theme="light"] body.auth-themed-page .auth-form-panel .input-group-text,
html[data-theme="light"] body.auth-themed-page .auth-form-panel .mobile-code {
  background: #f8fafc !important;
  border: 1px solid var(--auth-input-border) !important;
  color: #0f172a !important;
  border-radius: var(--auth-radius-sm) 0 0 var(--auth-radius-sm) !important;
  height: 46px !important;
  min-height: 46px !important;
}

html[data-theme="dark"] body.auth-themed-page .auth-form-panel .input-group-text,
html[data-theme="dark"] body.auth-themed-page .auth-form-panel .mobile-code {
  background: rgba(2, 6, 23, 0.72) !important;
  border: 1px solid var(--auth-input-border) !important;
  color: #f8fafc !important;
  border-radius: var(--auth-radius-sm) 0 0 var(--auth-radius-sm) !important;
  height: 46px !important;
  min-height: 46px !important;
}

body.auth-themed-page .auth-form-panel .input-group .form-control {
  border-radius: 0 var(--auth-radius-sm) var(--auth-radius-sm) 0 !important;
}

body.auth-themed-page .auth-form-panel .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  background-color: var(--auth-input-bg) !important;
  border: 1px solid var(--auth-input-border) !important;
}

body.auth-themed-page .auth-form-panel .form-check-input:checked {
  background-color: var(--auth-accent) !important;
  border-color: var(--auth-accent) !important;
}

/* Buttons */
body.auth-themed-page .auth-login-btn,
body.auth-themed-page .auth-form-panel .btn--base.auth-login-btn {
  background: var(--auth-accent) !important;
  border: 1px solid var(--auth-accent) !important;
  color: #fff !important;
  border-radius: var(--auth-radius-sm) !important;
  height: 48px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--auth-accent) 35%, transparent);
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

body.auth-themed-page .auth-login-btn:hover,
body.auth-themed-page .auth-form-panel .btn--base.auth-login-btn:hover {
  opacity: 0.95;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Logo / carousel */
.auth-logo {
  max-height: 56px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.auth-carousel {
  border-radius: var(--auth-radius);
  overflow: hidden;
  box-shadow: var(--auth-carousel-shadow);
  border: 1px solid var(--auth-panel-border);
  background: rgba(0, 0, 0, 0.15);
}

.auth-carousel .carousel-item img {
  width: 100%;
  height: min(70vh, 560px);
  object-fit: cover;
  display: block;
}

/* Nice-select (country dropdown) */
body.auth-themed-page .auth-form-panel .nice-select {
  background: var(--auth-input-bg) !important;
  border: 1px solid var(--auth-input-border) !important;
  color: var(--auth-input-text) !important;
  border-radius: var(--auth-radius-sm) !important;
  height: 46px !important;
  line-height: 44px !important;
  float: none;
  width: 100%;
}

body.auth-themed-page .auth-form-panel .nice-select .list {
  background: var(--auth-panel-bg) !important;
  border: 1px solid var(--auth-panel-border) !important;
  color: var(--auth-panel-text) !important;
  box-shadow: var(--auth-panel-shadow);
}

body.auth-themed-page .auth-form-panel .nice-select .option:hover,
body.auth-themed-page .auth-form-panel .nice-select .option.focus,
body.auth-themed-page .auth-form-panel .nice-select .option.selected.focus {
  background: var(--auth-accent-soft) !important;
  color: var(--auth-panel-text) !important;
}

/* Password strength popup */
body.auth-themed-page .auth-form-panel .input-popup {
  background: var(--auth-panel-bg) !important;
  border: 1px solid var(--auth-panel-border) !important;
  color: var(--auth-panel-text) !important;
}

/* Cookies */
body.auth-themed-page .cookies-card {
  background: var(--auth-cookie-bg) !important;
  color: var(--auth-panel-text) !important;
  border: 1px solid var(--auth-panel-border);
  box-shadow: var(--auth-panel-shadow);
}

body.auth-themed-page .cookies-card__content,
body.auth-themed-page .cookies-card p {
  color: var(--auth-panel-muted) !important;
}

body.auth-themed-page .cookies-card a {
  color: var(--auth-link) !important;
}

/* Required asterisk keeps brand red */
body.auth-themed-page .required::after,
body.auth-themed-page label.required:after {
  color: #ef4444;
}

@media (max-width: 991.98px) {
  .auth-account-section {
    padding: 72px 0 28px;
  }

  body.auth-themed-page .auth-form-panel,
  body.auth-themed-page .common-form-style.auth-form-panel {
    padding: 28px 20px !important;
    max-width: 100%;
  }

  .auth-theme-toggle {
    top: 12px;
    right: 12px;
  }
}
