/* ============================================
   AI Resume Builder — Auth Page Styles
   Claymorphism + Sandal/Green Theme
   ============================================ */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Floating decorative blobs */
.auth-page .auth-blob {
  position: absolute;
  border-radius: 50%;
  background: var(--clay-bg);
  box-shadow: var(--clay-shadow-out), var(--clay-shadow-in);
  z-index: 0;
  opacity: 0.6;
}

.auth-page .auth-blob-1 {
  width: 200px; height: 200px;
  top: -60px; left: -60px;
  animation: authFloat 8s ease-in-out infinite;
}

.auth-page .auth-blob-2 {
  width: 140px; height: 140px;
  bottom: -40px; right: -40px;
  animation: authFloat 6s ease-in-out infinite reverse;
}

.auth-page .auth-blob-3 {
  width: 80px; height: 80px;
  top: 20%; right: 15%;
  animation: authFloat 10s ease-in-out infinite 2s;
}

@keyframes authFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-25px) rotate(5deg); }
}

/* Auth Card */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--clay-bg);
  border-radius: var(--radius-2xl);
  box-shadow: var(--clay-shadow-out), var(--clay-shadow-in);
  padding: var(--space-12) var(--space-10);
  animation: authCardIn 0.6s ease-out;
}

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

/* Logo */
.auth-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  text-decoration: none;
  color: var(--text-primary);
}

.auth-card__logo-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clay-accent-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--clay-accent-shadow-out), var(--clay-accent-shadow-in);
  color: white;
}

.auth-card__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
}

/* Title & Subtitle */
.auth-card__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  text-align: center;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.auth-card__subtitle {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-8);
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-field__label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.auth-field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__icon {
  position: absolute;
  left: var(--space-4);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.auth-field__input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-12);
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--clay-shadow-pressed);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.auth-field__input:focus {
  outline: none;
  box-shadow: var(--clay-shadow-pressed-active), 0 0 0 2px var(--accent-primary);
  background: var(--bg-tertiary);
}

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

.auth-field__toggle-pw {
  position: absolute;
  right: var(--space-4);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.auth-field__toggle-pw:hover {
  color: var(--text-secondary);
}

/* Error Message */
.auth-error {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--danger-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--danger);
  animation: shakeIn 0.4s ease-out;
}

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

@keyframes shakeIn {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Submit Button */
.auth-submit {
  width: 100%;
  padding: var(--space-4);
  margin-top: var(--space-2);
  background: var(--clay-accent-bg);
  color: white;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--clay-accent-shadow-out), var(--clay-accent-shadow-in);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.auth-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: var(--clay-shadow-out-hover), var(--clay-accent-shadow-in);
}

.auth-submit:active {
  transform: translateY(1px);
  box-shadow: var(--clay-accent-shadow-in-active);
}

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

.auth-submit__spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

.auth-submit.loading .auth-submit__text { display: none; }
.auth-submit.loading .auth-submit__spinner { display: block; }

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

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-2) 0;
}

.auth-divider__line {
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.auth-divider__text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  font-weight: var(--font-medium);
}

/* Google Button */
.auth-google {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--clay-shadow-out), var(--clay-shadow-in);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.auth-google:hover {
  transform: translateY(-2px);
  box-shadow: var(--clay-shadow-out-hover), var(--clay-shadow-in-hover);
}

.auth-google:active {
  transform: translateY(1px);
  box-shadow: var(--clay-shadow-pressed);
}

.auth-google__icon {
  width: 20px; height: 20px;
}

/* Forgot Password */
.auth-forgot {
  text-align: right;
  margin-top: calc(var(--space-2) * -1);
}

.auth-forgot a {
  font-size: var(--text-xs);
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: var(--font-medium);
  transition: color var(--transition-fast);
}

.auth-forgot a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* Toggle link */
.auth-toggle {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.auth-toggle a {
  color: var(--accent-primary);
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-toggle a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* Reset Password View */
.auth-view { display: none; }
.auth-view.active { display: block; }

.auth-success {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--success-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--success);
}

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

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  margin-bottom: var(--space-4);
  transition: color var(--transition-fast);
  background: none;
  border: none;
}

.auth-back:hover {
  color: var(--accent-primary);
}

/* ═══════════════════════════════════════════
   RESPONSIVE — PHONE (≤768px)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .auth-page {
    padding: var(--space-4);
    align-items: flex-start;
    padding-top: var(--space-8);
  }

  .auth-card {
    padding: var(--space-8) var(--space-6);
    border-radius: var(--radius-xl);
    max-width: 100%;
  }

  .auth-card__title {
    font-size: var(--text-xl);
  }

  .auth-card__logo-icon {
    width: 40px;
    height: 40px;
  }

  .auth-card__logo-text {
    font-size: var(--text-xl);
  }

  /* Inputs: prevent iOS zoom */
  .auth-field__input {
    font-size: 16px;
  }

  /* Blobs: smaller on mobile */
  .auth-page .auth-blob-1 {
    width: 120px; height: 120px;
    top: -30px; left: -30px;
  }

  .auth-page .auth-blob-2 {
    width: 80px; height: 80px;
  }

  .auth-page .auth-blob-3 {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — SMALL PHONE (≤480px)
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
  .auth-page {
    padding: var(--space-3);
    padding-top: var(--space-6);
  }

  .auth-card {
    padding: var(--space-6) var(--space-4);
    border-radius: var(--radius-lg);
  }

  .auth-card__title {
    font-size: var(--text-lg);
  }

  .auth-card__subtitle {
    font-size: var(--text-xs);
  }

  .auth-form {
    gap: var(--space-4);
  }

  .auth-submit {
    padding: var(--space-3);
    font-size: var(--text-sm);
  }

  .auth-google {
    padding: var(--space-3);
    font-size: var(--text-xs);
  }

  .auth-toggle {
    font-size: var(--text-xs);
  }
}
