/* ----------------------------------------
   Royal Mystic theme (dark purple)
   ---------------------------------------- */

/* Color variables */
:root {
  --bg: #0b0810;           /* very dark background */
  --card: #120b18;         /* deep card color */
  --text: #efe6ff;         /* soft off-white for text */
  --accent: #b833ff;       /* primary purple accent */
  --glow: rgba(184, 51, 255, 0.45); /* glow for hover/focus */
  --muted: #7b698a;        /* muted text */
  --highlight: #ff43e6;    /* magenta highlight */
  --input-bg: rgba(255,255,255,0.02);
  --border: rgba(255,255,255,0.06);
}

/* Light theme variant (if user toggles) — purple on light */
[data-theme="light"] {
  --bg: none; /* we won't use this variable for gradient anymore */
  --card: #fff7ff;
  --text: #1a1120;
  --accent: #8a3bff;
  --glow: rgba(138, 59, 255, 0.25);
  --muted: #6d597a;
  --highlight: #b256ff;
  --input-bg: #ffffff;
  --border: rgba(0,0,0,0.06);
}

[data-theme="light"] body {
  background: linear-gradient(180deg, #f6effb 0%, #efe6ff 100%) fixed;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Reset & base */
* { box-sizing: border-box; margin:0; padding:0; }
html, body { height:100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 2rem;
  min-height: 100vh;
  transition: background 0.45s ease, color 0.35s ease;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Animated background layer (subtle radial swirls) */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 300px at 10% 20%, rgba(184,51,255,0.12), transparent 10%),
    radial-gradient(500px 260px at 85% 75%, rgba(255,67,230,0.10), transparent 10%);
  animation: bg-orbit 12s linear infinite;
  mix-blend-mode: overlay;
}
@keyframes bg-orbit {
  0%   { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(5%, -3%, 0) rotate(180deg) scale(1.02); }
  100% { transform: translate3d(0,0,0) rotate(360deg) scale(1); }
}

/* Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding-top: 3.2rem;
  position: relative;
  z-index: 5; /* above bg */
}

/* Heading */
h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
h1 .highlight {
  color: var(--highlight);
  font-weight: 900;
}

/* subtitle */
.subtitle {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Card/form */
form {
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
  border-radius: 16px;
  padding: 2.2rem;
  box-shadow: 0 10px 40px rgba(3,1,8,0.6), 0 2px 8px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

/* Fields */
.field { margin-bottom: 1.5rem; }
label {
  display: block;
  margin-bottom: .5rem;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
}
.note {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}
.hint {
  margin: .3rem 0 .8rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* Inputs */
input, textarea, select {
  width: 100%;
  padding: .75rem;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
input::placeholder, textarea::placeholder {
  color: #b3a8c9;
  opacity: 0.9;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 6px rgba(184,51,255,0.07), 0 6px 18px rgba(0,0,0,0.45);
}

/* textarea */
textarea { resize: vertical; min-height: 110px; }

/* custom select arrow */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237b698a'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 2.5rem;
}

/* Submit button (only form button is full width) */
form .submit-btn {
  margin-top: 1.5rem;
  background: linear-gradient(180deg, var(--accent), #8b2be6);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.95rem;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  width: 100%;
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
  box-shadow: 0 8px 30px rgba(136, 51, 255, 0.14);
}
form .submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(184,51,255,0.24);
  filter: saturate(1.08);
}

/* Status text */
#status {
  margin-top: 1.2rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
}

/* -------------------------
   Theme toggle - top right
   ------------------------- */
#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
  color: var(--text);
  border: 1.5px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 110;
  text-align: center;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s;
  box-shadow: 0 4px 14px rgba(3,1,8,0.6);
  backdrop-filter: blur(6px);
}
#theme-toggle .mode-text { display:inline-block; letter-spacing: .02em; }

/* Hover glow (purple) */
#theme-toggle:hover {
  transform: translateY(-4px);
  box-shadow:
    0 6px 24px rgba(3,1,8,0.6),
    0 0 18px var(--glow),
    0 0 6px rgba(255,67,230,0.12) inset;
}

/* small focus ring */
#theme-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 6px rgba(184,51,255,0.08), 0 6px 20px rgba(3,1,8,0.6);
}

/* Remove global full-width for toggle (if you had a global rule) */
#theme-toggle { width: auto !important; }

/* Minor responsive sizing */
@media (max-width: 560px) {
  h1 { font-size: 1.9rem; }
  .container { padding-top: 2.5rem; }
  #theme-toggle { top: 0.75rem; right: 0.75rem; padding: 0.38rem 0.9rem; font-size: 0.85rem; }
}

/* small accessible contrast improvements on light theme */
[data-theme="light"] form {
  box-shadow: 0 8px 24px rgba(16,12,20,0.06);
}

[data-theme="dark"] select,
[data-theme="dark"] option {
  color: #e4e4e7;     /* light gray text */
  background: #1a1a1d; /* dark menu background */
}
