/* ============================================================
   AUTH OVERLAY — STARSHIP PILOT ORB
   Smooth Cosmic Gradients · Circular HUD Instrument Pod
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@500;700;900&display=swap');

:root {
  --sp-hud-green:   #00ff9d;
  --sp-hud-blue:    #00b8ff;
  --sp-hud-amber:   #ffb800;
  --sp-hud-red:     #ff3b30;
  --sp-text:        #d2ffe9;
  --sp-text-dim:    #508266;
  --sp-glass:       rgba(2, 8, 20, 0.82);
  --sp-border:      rgba(0, 255, 157, 0.25);
  --sp-font-mono:   'Share Tech Mono', monospace;
  --sp-font-display:'Orbitron', sans-serif;
}

/* ── SMOOTH COSMIC GRADIENT BACKGROUND ────────────────────────── */
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #02050e;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
}

.auth-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

/* Overlapping smooth animated nebula clouds */
.auth-backdrop::before,
.auth-backdrop::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: blur(100px);
  pointer-events: none;
  z-index: 1;
}

/* Nebula 1 (Green/Teal) */
.auth-backdrop::before {
  top: -10%;
  left: -10%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(0, 255, 157, 0.12) 0%, rgba(0, 184, 255, 0.04) 50%, transparent 80%);
  animation: orbitNebula1 35s infinite alternate ease-in-out;
}

/* Nebula 2 (Purple/Blue) */
.auth-backdrop::after {
  bottom: -15%;
  right: -10%;
  width: 75%;
  height: 75%;
  background: radial-gradient(circle, rgba(142, 68, 255, 0.14) 0%, rgba(0, 184, 255, 0.05) 50%, transparent 80%);
  animation: orbitNebula2 40s infinite alternate ease-in-out;
}

@keyframes orbitNebula1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10%, 15%) scale(1.15); }
  100% { transform: translate(-5%, -5%) scale(0.9); }
}

@keyframes orbitNebula2 {
  0% { transform: translate(0, 0) scale(1.1); }
  50% { transform: translate(-15%, -10%) scale(0.9); }
  100% { transform: translate(5%, 10%) scale(1.2); }
}

/* Canvas overlay for simple interactive items if any */
.auth-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ── CIRCULAR INSTRUMENT POD (NONSTANDARD FORM FACTOR) ────────── */
.auth-drawer {
  position: relative;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: var(--sp-glass);
  border: 1.5px solid var(--sp-border);
  box-shadow: 
    0 0 45px rgba(0, 255, 157, 0.08),
    0 30px 80px rgba(0, 0, 0, 0.75),
    inset 0 0 25px rgba(0, 255, 157, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  transform: scale(0.9) rotate(-15deg);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3;
  overflow: hidden;
}

.auth-backdrop.visible .auth-drawer {
  transform: scale(1) rotate(0deg);
}

/* Top thin circular arc indicator */
.auth-drawer::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 255, 157, 0.15);
  pointer-events: none;
  animation: rotateCompass 120s linear infinite;
}

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

/* ── HEADER ────────────────────────────────────────────────── */
.drawer-header {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  z-index: 5;
}

.ab-brand-logo {
  font-size: 24px;
  color: var(--sp-hud-green);
  text-shadow: 0 0 10px var(--sp-hud-green);
  margin-bottom: 2px;
}

.ab-brand-name {
  font-family: var(--sp-font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sp-hud-green);
  text-shadow: 0 0 10px rgba(0, 255, 157, 0.4);
}

.ab-brand-tag {
  font-family: var(--sp-font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--sp-text-dim);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Telemetry stats (Simplified to a neat circular status bar row) */
.sp-telemetry {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 12px 0 6px;
  z-index: 5;
}

.sp-telem-item {
  font-family: var(--sp-font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--sp-text-dim);
}

.sp-telem-val {
  color: var(--sp-hud-blue);
}
.sp-telem-val.amber { color: var(--sp-hud-amber); }

/* ── FORM FIELDS ────────────────────────────────────────────── */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 270px;
  z-index: 5;
}
.auth-form.active { display: flex; }

.ab-field {
  position: relative;
  width: 100%;
}

.ab-field input {
  width: 100%;
  background: rgba(0, 12, 24, 0.4);
  border: 1px solid rgba(0, 255, 157, 0.16);
  border-radius: 20px;
  color: var(--sp-text);
  font-family: var(--sp-font-mono);
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
  text-align: center;
}

.ab-field input:focus {
  border-color: var(--sp-hud-green);
  background: rgba(0, 16, 32, 0.6);
  box-shadow: 0 0 12px rgba(0, 255, 157, 0.15);
}

.ab-field label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--sp-font-mono);
  font-size: 10px;
  color: var(--sp-text-dim);
  pointer-events: none;
  transition: all 0.22s ease;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ab-field input:focus + label,
.ab-field input:not(:placeholder-shown) + label {
  top: -8px;
  left: 50%;
  transform: translate(-50%, 0);
  font-size: 8px;
  color: var(--sp-hud-green);
  background: #040d1e;
  padding: 0 6px;
  border-radius: 4px;
}

.ab-field-icon {
  display: none; /* simple design - remove redundant icons inside field */
}

/* ── SUBMIT ACCESS TRIGGER ──────────────────────────────────── */
.auth-submit {
  position: relative;
  width: 100%;
  height: 40px;
  border: 1px solid var(--sp-hud-green);
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  font-family: var(--sp-font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sp-hud-green);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  transition: all 0.25s ease;
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.05);
}

.auth-submit:hover {
  background: rgba(0, 255, 157, 0.08);
  box-shadow: 0 0 18px rgba(0, 255, 157, 0.2);
}

.auth-submit:active {
  transform: scale(0.97);
}

.auth-submit:disabled {
  opacity: 0.3;
  cursor: default;
  border-color: var(--sp-text-dim);
  color: var(--sp-text-dim);
}

.submit-loader {
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(0, 255, 157, 0.2);
  border-top-color: var(--sp-hud-green);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── CLOSE BUTTON ───────────────────────────────────────────── */
.auth-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid rgba(0, 255, 157, 0.15);
  border-radius: 50%;
  color: var(--sp-text-dim);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.auth-close:hover {
  color: var(--sp-hud-red);
  border-color: rgba(255, 59, 48, 0.3);
  background: rgba(255, 59, 48, 0.06);
}

/* ── MESSAGES / STATUS ──────────────────────────────────────── */
.auth-msg {
  font-family: var(--sp-font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  min-height: 12px;
  color: transparent;
  justify-content: center;
  text-align: center;
  margin-top: 4px;
}

.auth-msg.error { color: var(--sp-hud-red); }
.auth-msg.success { color: var(--sp-hud-green); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-drawer {
    width: 320px;
    height: 320px;
    padding: 24px;
  }
  .auth-form {
    width: 220px;
  }
  .ab-brand-name {
    font-size: 16px;
  }
}
