/* ION Admin Console Login Styles – Improved with Spotlight/Glow */
:root {
  /* Brand color in RGB for easy alpha blends */
  --brand: 255, 215, 0;        /* gold */
  --spot-size: 600px;          /* base spotlight size */
  --spot-opacity: 0.12;        /* base spotlight opacity */
  --halo-opacity: 0.10;        /* soft card halo */
}

/* Base reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Login Card */
.container {
  position: relative;          /* required for pseudo-elements */
  z-index: 0;                  /* keep pseudo glows behind */
  overflow: visible;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Subtle ambient halo behind the card */
.container::before {
  content: "";
  position: absolute;
  inset: -32px; /* extend around card */
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(260px circle at 50% 0%,
      rgba(var(--brand), var(--halo-opacity)), transparent 60%);
  filter: blur(10px);
  opacity: 1;
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

/* Spotlight that can follow pointer (uses CSS vars if provided) */
.container::after {
  content: "";
  position: absolute;
  inset: -40px;
  z-index: -1;
  pointer-events: none;
  /* Defaults to center if no JS sets --spot-x/--spot-y */
  background:
    radial-gradient(var(--spot-size) circle at var(--spot-x, 50%) var(--spot-y, 50%),
      rgba(var(--brand), var(--spot-opacity)), transparent 60%);
  filter: blur(8px);
  opacity: 0.7; /* visible but soft by default */
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

/* Elevate halo + spotlight on hover/focus within */
.container:hover,
.container:focus-within {
  transform: translateY(-1px);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.container:hover::before,
.container:focus-within::before {
  opacity: 1;
  filter: blur(12px);
}

.container:hover::after,
.container:focus-within::after {
  opacity: 1;
  filter: blur(6px);
}

/* Logo */
.logo img {
  width: 180px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Titles */
.title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 16px;
  color: #cccccc;
  margin-bottom: 30px;
  font-weight: 400;
}

#messageBox {
  min-height: 20px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

/* Form */
form { width: 100%; }
form.hidden { display: none; }

/* Inputs */
input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 16px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="email"]::placeholder { color: #999999; }

input[type="email"]:focus {
  outline: none;
  border-color: rgb(var(--brand));
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 3px rgba(var(--brand), 0.12),
    0 6px 20px rgba(var(--brand), 0.18);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

.btn:active { transform: translateY(0); }

/* Google OAuth-like button */
.inline-flex {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: transparent;
  padding: 12px 24px;
  font-size: 14px;
  gap: 12px;
  width: 100%;
  margin-bottom: 10px;
}

.inline-flex:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: #ffffff;
}

.flex-shrink-0 { flex-shrink: 0; }

/* OTP */
.otp-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.otp-digit {
  width: 45px;
  height: 45px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.otp-digit:focus {
  outline: none;
  border-color: rgb(var(--brand));
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 3px rgba(var(--brand), 0.12),
    0 6px 18px rgba(var(--brand), 0.18);
}

/* Timers and states */
.timer { color: #cccccc; font-size: 14px; margin-bottom: 20px; }
#countdown { color: #ffd700; font-weight: 600; }
.success { color: #00cc66; }
.error { color: #ff4d4d; }
.info { color: #cccccc; }

/* Resend button */
#resend-btn {
  background: #6c757d;
  font-size: 14px;
  margin-top: 10px;
}
#resend-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .container,
  .container::before,
  .container::after,
  .btn,
  .inline-flex,
  input[type="email"],
  .otp-digit {
    transition: none !important;
  }
}

/* Responsive – Tablets */
@media screen and (max-width: 768px) {
  body { padding: 15px; }

  .container {
    padding: 30px 25px;
    /* Slightly smaller glow for tighter viewports */
    --spot-size: 520px;
  }

  .logo img { width: 160px; }
  .title { font-size: 26px; }
  .subtitle { font-size: 15px; margin-bottom: 25px; }

  /* Fix iOS zoom */
  input[type="email"],
  input[type="text"],
  input[type="number"],
  .otp-digit { font-size: 16px !important; }
}

/* Responsive – Mobile */
@media screen and (max-width: 480px) {
  body { padding: 10px; }

  .container {
    padding: 25px 20px;
    margin: 0;
    max-width: 100%;
    --spot-size: 460px;
  }

  .logo img { width: 150px; }
  .title { font-size: 24px; }
  .subtitle { font-size: 14px; margin-bottom: 20px; }
  #messageBox { font-size: 13px; margin-bottom: 15px; }

  input[type="email"] {
    padding: 12px 14px;
    font-size: 16px;
    margin-bottom: 15px;
  }

  .btn { padding: 12px 16px; font-size: 15px; }
  .inline-flex { padding: 10px 16px; font-size: 13px; gap: 10px; }
  .inline-flex svg { width: 18px; height: 18px; }

  .otp-boxes { gap: 6px; }
  .otp-digit { width: 40px; height: 40px; font-size: 16px; }
  .timer { font-size: 13px; }
  #resend-btn { font-size: 13px; }
}

/* Very small phones */
@media screen and (max-width: 375px) {
  .container { padding: 20px 15px; --spot-size: 420px; }
  .logo img { width: 130px; }
  .title { font-size: 22px; margin-bottom: 6px; }
  .subtitle { font-size: 13px; margin-bottom: 15px; }
  .otp-boxes { gap: 4px; }
  .otp-digit { width: 38px; height: 38px; font-size: 15px; }
}

/* Landscape on mobile */
@media screen and (max-height: 600px) and (orientation: landscape) {
  body { padding: 10px; }

  .container { padding: 20px 25px; }
  .logo img { width: 120px; margin-bottom: 10px; }
  .title { font-size: 22px; margin-bottom: 5px; }
  .subtitle { font-size: 13px; margin-bottom: 15px; }
  #messageBox { margin-bottom: 10px; }

  input[type="email"] { padding: 10px 14px; margin-bottom: 10px; }
  .btn { padding: 10px 16px; }
  .otp-digit { width: 35px; height: 35px; }
}