/* ==========================================================================
   THE AI FELLOWSHIP - Authentication Pages
   Session 2: Auth Styles
   Depends on: css/design-system.css
   ========================================================================== */


/* ==========================================================================
   1. AUTH PAGE LAYOUT
   ========================================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-white);
}

/* Full-screen gradient background */
.auth-layout {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  min-height: calc(100vh - 56px); /* subtract footer height */
}

/* Gradient background layer */
.auth-bg {
  position: fixed;
  inset: 0;
  background: var(--gradient-brand);
  z-index: 0;
}

/* Subtle noise/texture overlay for depth */
.auth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 60%
  ),
  radial-gradient(
    ellipse at 80% 80%,
    rgba(158, 64, 165, 0.25) 0%,
    transparent 60%
  );
}


/* ==========================================================================
   2. AUTH CARD
   ========================================================================== */

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-xl),
              0 0 0 1px rgba(255, 255, 255, 0.1);
}

@media (min-width: 480px) {
  .auth-card {
    padding: var(--space-10) var(--space-8);
  }
}


/* ==========================================================================
   3. AUTH LOGO
   ========================================================================== */

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.auth-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}


/* ==========================================================================
   4. AUTH HEADER
   ========================================================================== */

.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-title {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  margin-bottom: 0;
}


/* ==========================================================================
   5. AUTH FORM
   ========================================================================== */

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

/* Row with label + forgot password link */
.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.auth-label-row .form-label {
  margin-bottom: 0;
}

.auth-forgot-link {
  font-size: var(--font-size-small);
  color: var(--color-off-red);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

.auth-forgot-link:hover {
  color: var(--color-warm-purple);
}

.auth-forgot-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Password visibility toggle */
.auth-toggle-password {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: none;
  border: none;
  padding: var(--space-1);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

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

.auth-toggle-password:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Ensure password input has room for toggle icon */
.form-input-wrapper .form-input[type="password"] {
  padding-right: var(--space-10);
}

/* Remember me row */
.auth-remember {
  margin-top: var(--space-1);
  margin-bottom: var(--space-2);
}

/* Submit button — extra top margin */
.auth-submit-btn {
  margin-top: var(--space-2);
  padding-block: var(--space-4);
  font-size: 15px;
  letter-spacing: 0.01em;
}


/* ==========================================================================
   6. DIVIDER
   ========================================================================== */

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block: var(--space-5);
}

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

.auth-divider-text {
  font-size: var(--font-size-tiny);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
}


/* ==========================================================================
   7. GOOGLE SIGN-IN BUTTON
   ========================================================================== */

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding-block: var(--space-3);
  background-color: var(--color-white);
  color: var(--color-text-primary);
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-md);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

.auth-google-btn:hover {
  background-color: var(--color-silver);
  border-color: #9CA3AF;
  box-shadow: var(--shadow-sm);
}

.auth-google-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.auth-google-btn img {
  flex-shrink: 0;
}


/* ==========================================================================
   8. SIGN UP PROMPT
   ========================================================================== */

.auth-signup-prompt {
  text-align: center;
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  margin-top: var(--space-5);
  margin-bottom: 0;
}

.auth-link {
  color: var(--color-off-red);
  font-weight: var(--font-weight-semibold);
  transition: color var(--transition-fast);
}

.auth-link:hover {
  color: var(--color-warm-purple);
}

.auth-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ==========================================================================
   9. AUTH FOOTER
   ========================================================================== */

.auth-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-4) var(--space-4);
  background: transparent;
}

.auth-footer p {
  font-size: var(--font-size-tiny);
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0;
}

.auth-footer-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
}

.auth-footer-link:hover {
  color: var(--color-white);
  text-decoration: underline;
}

.auth-footer-link:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ==========================================================================
   10. FORM VALIDATION STATES (auth-specific overrides)
   ========================================================================== */

/* Inline error message below input */
.auth-form .form-error-message {
  margin-top: var(--space-1);
}

/* General auth error banner (e.g. wrong credentials) */
.auth-error-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-status-inactive-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.auth-error-banner p {
  font-size: var(--font-size-small);
  color: var(--color-status-inactive);
  margin-bottom: 0;
}


/* ==========================================================================
   11. RESPONSIVE ADJUSTMENTS
   ========================================================================== */

/* On very small screens, reduce card padding */
@media (max-width: 360px) {
  .auth-card {
    padding: var(--space-6) var(--space-4);
    border-radius: var(--radius-lg);
  }

  .auth-title {
    font-size: 22px;
  }
}

/* Tablet and up — card gets a bit more breathing room */
@media (min-width: 768px) {
  .auth-layout {
    padding: var(--space-8);
  }
}
