/* ============================================================
   premium-auth.css — Shared styles for splash & client login
   ============================================================ */

:root {
  --bg: #07111f;
  --card: rgba(255, 255, 255, 0.02);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-glow: 0 0 48px rgba(0, 245, 160, 0.08);
  --text: #e6f1ff;
  --muted: #7a8ba5;
  --border: rgba(0, 255, 170, 0.15);
  --primary: #00f5a0;
  --primary-dark: #00d88a;
  --danger: #ff4d6d;
  --radius: 12px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Gradient orbs (background) --- */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow::before,
.bg-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(200px);
}

.bg-glow::before {
  width: 700px; height: 700px;
  bottom: -20%; left: -10%;
  background: rgba(0, 245, 160, 0.05);
  animation: orbDrift1 20s ease-in-out infinite;
}

.bg-glow::after {
  width: 500px; height: 500px;
  top: -15%; right: -8%;
  background: rgba(0, 255, 204, 0.035);
  animation: orbDrift2 25s ease-in-out infinite;
}

@keyframes orbDrift1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(60px, -40px); }
}
@keyframes orbDrift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-50px, 30px); }
}

/* --- Particles --- */
.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: particleRise linear infinite;
}

@keyframes particleRise {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  8% { opacity: var(--p-peak, 0.12); }
  85% { opacity: var(--p-peak, 0.12); }
  100% {
    transform: translateY(calc(-100vh - 40px)) translateX(var(--p-sway, 20px));
    opacity: 0;
  }
}

/* --- Entry animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim-entry {
  opacity: 0;
  animation: fadeInUp 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.anim-d0 { animation-delay: 0ms; }
.anim-d1 { animation-delay: 150ms; }
.anim-d2 { animation-delay: 300ms; }
.anim-d3 { animation-delay: 450ms; }
.anim-d4 { animation-delay: 600ms; }

/* --- CTA button --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  color: #07111f;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
  position: relative;
  overflow: hidden;
  min-height: 48px;
}

.btn-primary:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 0 32px rgba(0, 245, 160, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 245, 160, 0.4);
}

/* --- Input fields --- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 150ms ease;
}

.field-group:focus-within .field-label {
  color: var(--primary);
}

.field-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
  -webkit-appearance: none;
}

.field-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.field-input:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.14);
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 245, 160, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

/* Chrome autofill override */
.field-input:-webkit-autofill,
.field-input:-webkit-autofill:hover,
.field-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0b1a2e inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}

/* --- Custom checkbox --- */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  flex-shrink: 0;
}

.checkbox-wrap input:checked + .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-box svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.checkbox-wrap input:checked + .checkbox-box svg {
  opacity: 1;
}

.checkbox-wrap input:focus-visible + .checkbox-box {
  box-shadow: 0 0 0 3px rgba(0, 245, 160, 0.3);
}

.checkbox-label {
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Error message --- */
.form-error {
  display: none;
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 16px;
  text-align: center;
}

.form-error.visible {
  display: block;
}

/* --- Loading spinner (CSS only) --- */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid #07111f;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

.btn-primary.is-loading .btn-label { opacity: 0; }
.btn-primary.is-loading .btn-spinner { display: block; position: absolute; }

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Shake --- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.shake {
  animation: shake 200ms ease;
}

/* --- Footer --- */
.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.4;
  padding: 32px;
  z-index: 1;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .particles-container { display: none; }
  .bg-glow::before, .bg-glow::after { animation: none; }
  .anim-entry { opacity: 1; }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .field-input {
    height: 52px;
    font-size: 1rem; /* prevent iOS zoom */
  }
}
