/* =========================================
   ResellerAI — Auth Pages (Login / Signup)
   Design System: Dark SaaS, consistent with dashboard
   ========================================= */

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

:root {
  --primary:      #00d4ff;
  --primary-dim:  rgba(0, 212, 255, 0.12);
  --green:        #00ff88;
  --green-dim:    rgba(0, 255, 136, 0.12);
  --purple:       #7b2ff7;
  --red:          #ff6b6b;

  --bg:           #0a0a0a;
  --surface:      rgba(255,255,255,0.04);
  --surface-2:    rgba(255,255,255,0.07);
  --border:       rgba(255,255,255,0.08);
  --border-2:     rgba(255,255,255,0.12);

  --text:         #e0e0e0;
  --text-muted:   #9a9a9a;
  --text-dim:     #666666;

  --radius:       14px;
  --transition:   0.2s ease;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Background ── */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}

.auth-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 20%, rgba(0,212,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 600px 400px at 80% 80%, rgba(123,47,247,0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Auth card ── */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #111;
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 40px 36px;
  position: relative;
  z-index: 1;

  /* Top edge accent */
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--purple), transparent);
    opacity: 0.5;
  }
}

/* ── Logo ── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 32px;
  justify-content: center;
}

.auth-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.auth-logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

/* ── Headings ── */
.auth-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 6px;
  text-align: center;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  background: rgba(0, 212, 255, 0.04);
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-input.error {
  border-color: var(--red);
  background: rgba(255, 107, 107, 0.04);
}

.field-error {
  font-size: 12px;
  color: var(--red);
  display: none;
}

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

/* Password field with toggle */
.input-with-toggle {
  position: relative;
}

.input-with-toggle .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.password-toggle:hover {
  color: var(--text-muted);
}

/* ── Submit button ── */
.btn-auth {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity var(--transition), transform var(--transition);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-auth:hover {
  opacity: 0.9;
}

.btn-auth:active {
  transform: scale(0.99);
}

.btn-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-auth .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn-auth.loading .spinner {
  display: block;
}

.btn-auth.loading .btn-text {
  opacity: 0.7;
}

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

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 12px;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Footer links ── */
.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 24px;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ── Trust indicators ── */
.auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
}

.trust-item svg {
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Alert box ── */
.auth-alert {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  display: none;
  align-items: flex-start;
  gap: 10px;
}

.auth-alert.visible {
  display: flex;
}

.auth-alert--error {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.2);
  color: #ff9a9a;
}

.auth-alert--success {
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: var(--green);
}

.auth-alert-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Forgot password link ── */
.forgot-link {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  text-align: right;
  display: block;
  margin-top: -8px;
  transition: color var(--transition);
}

.forgot-link:hover {
  color: var(--primary);
}

/* ── OAuth / Social buttons ── */
.btn-oauth {
  width: 100%;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--transition), border-color var(--transition);
}

.btn-oauth:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

/* ── Promo banner (signup only) ── */
.auth-promo {
  background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(123,47,247,0.08));
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.auth-promo strong {
  color: var(--primary);
}

/* ── Password strength ── */
.password-strength {
  margin-top: 4px;
}

.strength-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
  width: 0%;
}

.strength-text {
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Checkbox ── */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.checkbox-group a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-group a:hover {
  text-decoration: underline;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
    border-radius: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .auth-trust {
    flex-direction: column;
    gap: 8px;
  }
}
