/* ═══════════════════════════════════════════
   NEXMENT — auth.css
   Full auth page: background, card, tabs,
   inputs, Google btn, password strength,
   submit, toast, responsive
═══════════════════════════════════════════ */

/* ── TOKENS (self-contained, no global.css needed) ── */
:root {
  --bg:            #f9f8ff;
  --surface:       #ffffff;
  --surface-2:     #f7f5ff;

  --accent:        #7c3aed;
  --accent-mid:    #9333ea;
  --accent-light:  #a855f7;
  --accent-pale:   #ede9fe;
  --accent-border: #ddd6fe;
  --accent-glow:   rgba(124, 58, 237, 0.18);

  --text-primary:  #1a1230;
  --text-secondary:#4b4468;
  --text-muted:    #8b82a8;
  --border:        #e8e3f4;
  --border-strong: #ccc5e8;

  --error:         #dc2626;
  --error-bg:      #fef2f2;
  --success:       #16a34a;

  --radius:        16px;
  --radius-sm:     10px;
  --radius-pill:   999px;

  --font:          'Plus Jakarta Sans', sans-serif;
  --shadow-md:     0 4px 24px rgba(100,60,200,0.10), 0 1px 4px rgba(100,60,200,0.06);
  --shadow-lg:     0 8px 48px rgba(100,60,200,0.16);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}
img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ══════════════════════════════════════════
   BACKGROUND
══════════════════════════════════════════ */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.auth-orb-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(124,58,237,0.13) 0%, transparent 70%);
  top: -140px; right: -140px;
}
.auth-orb-2 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(168,85,247,0.10) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}
.auth-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(124,58,237,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 100%);
}

/* ══════════════════════════════════════════
   BACK BUTTON
══════════════════════════════════════════ */
.auth-back {
  position: fixed;
  top: 20px; left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  z-index: 100;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.18s, box-shadow 0.2s;
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.auth-back:hover {
  color: var(--accent);
  background: var(--accent-pale);
  border-color: var(--accent-border);
  transform: translateX(-2px);
}

/* ══════════════════════════════════════════
   MAIN / CARD
══════════════════════════════════════════ */
.auth-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 32px;
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.42s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── LOGO ── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  justify-content: center;
}
.auth-logo-img {
  width: 44px; height: 44px;
  border-radius: 16px;
  object-fit: contain;
}
.auth-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.auth-brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.4px;
  line-height: 1;
}
.auth-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── TABS ── */
.auth-tabs {
  position: relative;
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 28px;
  gap: 0;
}
.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 0.25s;
  text-align: center;
}
.auth-tab.active { color: var(--accent); }

.auth-tab-slider {
  position: absolute;
  top: 4px; left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(100,60,200,0.10);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  border: 1px solid var(--accent-border);
}
.auth-tab-slider.right { transform: translateX(100%); }

/* ── FORMS WRAP ── */
.auth-forms-wrap {
  position: relative;
  overflow: hidden;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: formSlideIn 0.3s ease both;
}
.auth-form.active { display: flex; }

@keyframes formSlideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes formSlideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.auth-form.slide-left { animation: formSlideInLeft 0.3s ease both; }

/* ── GOOGLE BUTTON ── */
.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}
.auth-google-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent-border);
  box-shadow: 0 2px 12px var(--accent-glow);
  transform: translateY(-1px);
}
.auth-google-btn:active { transform: translateY(0); }
.auth-google-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ── OR DIVIDER ── */
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.auth-or::before,
.auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── FIELD ── */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.auth-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.forgot-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}
.forgot-link:hover { opacity: 0.75; text-decoration: underline; }

/* ── INPUT WRAP ── */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
  z-index: 1;
  transition: color 0.2s;
}
.auth-input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
}
.auth-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}
.auth-input-wrap input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon { color: var(--accent); }
.auth-input-wrap input::placeholder { color: var(--text-muted); }
.auth-input-wrap input.input-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.10);
}

/* Password visibility toggle */
.pass-toggle {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
  z-index: 1;
}
.pass-toggle:hover { color: var(--accent); }
.auth-input-wrap input[type="password"],
.auth-input-wrap input[type="text"] {
  padding-right: 40px; /* space for toggle */
}

/* ── FIELD ERROR ── */
.auth-field-err {
  font-size: 11.5px;
  color: var(--error);
  font-weight: 500;
  min-height: 15px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}

/* ── PASSWORD STRENGTH ── */
.pass-strength {
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 2px;
}
.pass-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  transition: width 0.35s ease, background 0.35s ease;
}
.pass-strength-bar.weak   { width: 33%;  background: #ef4444; }
.pass-strength-bar.medium { width: 66%;  background: #f59e0b; }
.pass-strength-bar.strong { width: 100%; background: #22c55e; }

.pass-strength-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}
.pass-strength-label.weak   { color: #ef4444; }
.pass-strength-label.medium { color: #d97706; }
.pass-strength-label.strong { color: #16a34a; }

/* ── LEGAL NOTE ── */
.auth-legal {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: -4px;
}
.auth-legal a {
  color: var(--accent);
  font-weight: 600;
}
.auth-legal a:hover { text-decoration: underline; }

/* ── SUBMIT BUTTON ── */
.auth-submit-btn {
  width: 100%;
  padding: 13px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 4px 18px var(--accent-glow);
  margin-top: 4px;
}
.auth-submit-btn:hover:not(:disabled) {
  background: var(--accent-mid);
  box-shadow: 0 8px 28px var(--accent-glow);
  transform: translateY(-1px);
}
.auth-submit-btn:active:not(:disabled) { transform: translateY(0); }
.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}
.btn-label,
.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
.auth-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  max-width: 90vw;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.auth-toast.toast-success { background: #166534; }
.auth-toast.toast-error   { background: #991b1b; }
.auth-toast.toast-info    { background: var(--accent); }

/* ══════════════════════════════════════════
   LOADING OVERLAY (full card)
══════════════════════════════════════════ */
.auth-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(249,248,255,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  z-index: 20;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.auth-card { position: relative; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px 24px;
    border-radius: 20px;
  }
  .auth-main { padding: 72px 12px 24px; }
}

@media (max-width: 360px) {
  .auth-card { padding: 24px 16px 20px; }
  .auth-submit-btn { font-size: 14px; padding: 12px; }
}
