/* ============================================
   MODIH MAIL — Auth Pages Shared Styles
   login.html, signup.html
   Shares the same design language as styles.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@300;400;500;600;700&family=Dancing+Script:wght@400;500;600;700&display=swap');

/* ========== ROOT TOKENS (identical to main site) ========== */
:root {
  --bg-dark: #0a0a0f;
  --glass-bg: rgba(30, 25, 20, 0.65);
  --glass-bg-hover: rgba(45, 38, 30, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(212, 167, 106, 0.3);
  --text-primary: #fff;
  --text-secondary: rgba(255, 255, 255, 0.82);
  --text-muted: rgba(255, 255, 255, 0.55);
  --accent: #d4a76a;
  --accent-glow: rgba(212, 167, 106, 0.35);
  --accent-secondary: #e8cfa0;
  --accent-warm: #c8956a;
  --danger: #f87171;
  --success: #34d399;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ========== BACKGROUND VIDEO (same as main site) ========== */
.auth-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 0;
  overflow: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

.auth-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: translateZ(0);
  will-change: transform;
  display: block;
}

.auth-bg .bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.4),
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.4)
  );
}

/* ========== NAV (same pill style) ========== */
.auth-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 2rem;
  pointer-events: none;
}

.auth-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

.auth-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.auth-nav-brand:hover { transform: scale(1.05); }

.auth-brand-text {
  font-family: 'Playfair Display', 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 700;
  font-style: italic;
  background: linear-gradient(90deg, #FFD700, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: var(--transition);
}

.auth-nav-link:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* ========== PAGE LAYOUT ========== */
.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 3rem;
}

/* ========== AUTH CARD ========== */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(16, 14, 12, 0.72);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow:
    0 25px 80px rgba(0,0,0,0.5),
    0 1px 0 rgba(255,255,255,0.05) inset;
  animation: cardIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

/* ========== AUTH CARD HEADER ========== */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(212,167,106,0.4));
}

.auth-title {
  font-family: 'Cormorant Garamond', 'Playfair Display', serif;
  font-size: 2.1rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.2;
  margin-bottom: 0.45rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.auth-title .accent {
  background: linear-gradient(135deg, #d4a76a, #f5e6c8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========== OAUTH BUTTONS ========== */
.oauth-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  transition: var(--transition);
  text-decoration: none;
  width: 100%;
}

.oauth-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.oauth-btn:active { transform: scale(0.97); }

.oauth-btn svg, .oauth-btn img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ========== DIVIDER ========== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.auth-divider span {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ========== FORM ========== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.auth-input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.97rem;
  outline: none;
  transition: var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(212,167,106,0.05);
}

.auth-input::placeholder { color: var(--text-muted); }

.auth-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(248,113,113,0.2);
}

/* Password field wrapper */
.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .auth-input {
  padding-right: 3rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

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

/* ========== SUBMIT BUTTON ========== */
.auth-submit {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, rgba(212,167,106,0.95), rgba(200,149,106,0.9));
  color: #0a0a0f;
  transition: var(--transition);
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(212,167,106,0.35);
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212,167,106,0.5);
  background: linear-gradient(135deg, rgba(230,185,120,1), rgba(212,167,106,1));
}

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

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

/* ========== BUTTON LOADING & SUCCESS STATES (Stripe-style) ========== */

/* Loading state — subtle shimmer pulse, no spinning character */
.auth-submit.is-loading {
  pointer-events: none;
  opacity: 0.85;
  position: relative;
  overflow: hidden;
}
.auth-submit.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.18) 50%,
    transparent 100%
  );
  animation: btn-shimmer 1.2s ease infinite;
}
@keyframes btn-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Success state — green fill sweeps left→right, then tick fades in */
.auth-submit.is-success {
  pointer-events: none;
  border: none;
  background: linear-gradient(135deg, #34d399, #10b981) !important;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(52,211,153,0.45) !important;
  transition: background 0.4s ease, box-shadow 0.4s ease, color 0.2s ease;
}
.auth-submit.is-success .btn-check {
  display: inline-block;
  animation: checkPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes checkPop {
  from { opacity: 0; transform: scale(0.4) rotate(-20deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ========== MESSAGES ========== */
.auth-error {
  padding: 0.8rem 1rem;
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.88rem;
  display: none;
  line-height: 1.4;
}

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

.auth-success {
  padding: 1rem 1.2rem;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: 10px;
  color: #6ee7b7;
  font-size: 0.9rem;
  text-align: center;
  display: none;
  line-height: 1.5;
}

.auth-success.visible { display: block; }

/* ========== FOOTER LINK ========== */
.auth-footer-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-footer-link a {
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-footer-link a:hover { color: #fff; }

/* ========== PLAN BADGE (on auth pages from redirect) ========== */
.auth-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(212,167,106,0.12);
  border: 1px solid rgba(212,167,106,0.3);
  border-radius: 100px;
  padding: 0.25rem 0.9rem;
  margin-bottom: 0.75rem;
}

.auth-plan-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(212,167,106,0.7);
}

/* ========== INFO NOTE ========== */
.auth-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.5;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  .auth-nav { padding: 1.1rem 1.25rem; }
  .auth-brand-text { font-size: 1.5rem; }
  .auth-page { padding: 5rem 1rem 2rem; }
  .auth-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  .auth-title { font-size: 1.8rem; }
}
@media (max-width: 400px) {
  .auth-card { padding: 1.75rem 1.1rem; border-radius: 16px; }
  .auth-title { font-size: 1.6rem; }
  .auth-submit { font-size: 0.95rem; }
  .oauth-btn { font-size: 0.88rem; padding: 0.75rem 1rem; }
}
