/* ==========================================================================
   PLANT AI — AUTH PAGES (Login & Register)
   Premium Glassmorphism Design with Animated Background
   ========================================================================== */

/* FONTS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* VARIABLES */
:root {
  --auth-bg-start: #020e06;
  --auth-bg-end: #0a2e14;
  --auth-glass: rgba(12, 42, 22, 0.65);
  --auth-glass-border: rgba(184, 216, 65, 0.2);
  --auth-glass-border-hover: rgba(184, 216, 65, 0.4);
  --auth-accent: #b8d841;
  --auth-accent-green: #65c42f;
  --auth-primary-green: #2d8d22;
  --auth-text: #ffffff;
  --auth-text-secondary: #cde5c2;
  --auth-text-muted: #8ba880;
  --auth-danger: #ef4444;
  --auth-warning: #f59e0b;
  --auth-success: #10b981;
}

/* ==============================
   PAGE BASE
   ============================== */
.auth-page {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, var(--auth-bg-start), var(--auth-bg-end));
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* ==============================
   ANIMATED PARTICLES BACKGROUND
   ============================== */
.auth-bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: float-particle linear infinite;
}

.p1 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--auth-accent), transparent 70%);
  top: -100px; left: -80px;
  animation-duration: 22s;
}
.p2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--auth-accent-green), transparent 70%);
  bottom: 5%; right: 8%;
  animation-duration: 18s;
  animation-delay: -4s;
}
.p3 {
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--auth-success), transparent 70%);
  top: 35%; right: -40px;
  animation-duration: 26s;
  animation-delay: -8s;
}
.p4 {
  width: 100px; height: 100px;
  background: radial-gradient(circle, var(--auth-accent), transparent 70%);
  bottom: 20%; left: 12%;
  animation-duration: 20s;
  animation-delay: -12s;
}
.p5 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, var(--auth-primary-green), transparent 70%);
  top: 60%; left: 50%;
  animation-duration: 30s;
  animation-delay: -6s;
}

@keyframes float-particle {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(30px, -40px) scale(1.1); }
  50%  { transform: translate(-20px, 20px) scale(0.95); }
  75%  { transform: translate(15px, 35px) scale(1.05); }
  100% { transform: translate(0, 0) scale(1); }
}

/* ==============================
   BRAND / LOGO
   ============================== */
.auth-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

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

.brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 8px rgba(184, 216, 65, 0.3));
}

.brand-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--auth-accent);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(184, 216, 65, 0.15);
}

/* ==============================
   CENTER LAYOUT
   ============================== */
.auth-center {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
  width: 100%;
}

/* ==============================
   GLASSMORPHISM CARD
   ============================== */
.auth-glass-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px 36px;
  border-radius: 28px;
  background: var(--auth-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--auth-glass-border);
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: cardReveal 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

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

/* ==============================
   HEADER
   ============================== */
.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-icon-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(184, 216, 65, 0.15), rgba(45, 141, 34, 0.15));
  border: 2px solid rgba(184, 216, 65, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: ringPulse 3s ease-in-out infinite;
}

.auth-icon-ring i {
  font-size: 1.5rem;
  color: var(--auth-accent);
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 216, 65, 0.12); }
  50%      { box-shadow: 0 0 0 14px rgba(184, 216, 65, 0); }
}

.auth-header h1 {
  color: var(--auth-text);
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.auth-header p {
  color: var(--auth-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ==============================
   CUSTOM ALERT SYSTEM
   ============================== */
.auth-alerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid;
  animation: alertSlide 0.35s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-alert-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-alert-content i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.auth-alert-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 4px;
  font-size: 0.85rem;
  transition: opacity 0.2s;
}

.auth-alert-close:hover {
  opacity: 1;
}

/* Alert variants */
.auth-alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.auth-alert-danger i { color: #ef4444; }

.auth-alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}
.auth-alert-warning i { color: #f59e0b; }

.auth-alert-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #86efac;
}
.auth-alert-success i { color: #10b981; }

.auth-alert-info {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}
.auth-alert-info i { color: #3b82f6; }

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

/* INPUT GROUP */
.auth-input-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.auth-input-group:focus-within {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(184, 216, 65, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  margin-right: 12px;
}

.input-icon i {
  font-size: 0.95rem;
  color: var(--auth-text-muted);
  transition: color 0.25s ease;
}

.auth-input-group:focus-within .input-icon i {
  color: var(--auth-accent);
}

.auth-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--auth-text);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 15px 0;
}

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

/* Password toggle */
.toggle-pw {
  background: none;
  border: none;
  color: var(--auth-text-muted);
  cursor: pointer;
  padding: 6px;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.toggle-pw:hover {
  color: var(--auth-accent);
}

/* ==============================
   PASSWORD STRENGTH INDICATOR
   ============================== */
.pw-strength {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: -6px;
}

.pw-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.pw-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width 0.35s ease, background 0.35s ease;
}

.pw-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 70px;
  text-align: right;
}

/* ==============================
   SUBMIT BUTTON
   ============================== */
.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--auth-primary-green), var(--auth-accent-green));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(45, 141, 34, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 6px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(45, 141, 34, 0.5);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.auth-submit-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* ==============================
   FOOTER
   ============================== */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-footer p {
  color: var(--auth-text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.auth-link {
  color: var(--auth-accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: #d4f055;
}

.auth-link i {
  font-size: 0.75rem;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.auth-link:hover i {
  transform: translateX(3px);
}

/* ==============================
   SUBMIT BUTTON — LOADING STATE
   ============================== */
.auth-submit-btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
  background: linear-gradient(135deg, #1f6d18, #4a9e30);
  position: relative;
  overflow: hidden;
}

.auth-submit-btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.12) 50%,
    transparent 100%
  );
  animation: btnShimmer 1.4s ease-in-out infinite;
}

@keyframes btnShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

/* ==============================
   SUCCESS OVERLAY
   ============================== */
.auth-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(2, 14, 6, 0.92);
  backdrop-filter: blur(12px);
  animation: overlayFadeIn 0.4s ease forwards;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.success-check-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--auth-primary-green), var(--auth-accent-green));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px rgba(45, 141, 34, 0.5);
  animation: successBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.success-check-circle i {
  font-size: 2.8rem;
  color: #fff;
}

@keyframes successBounce {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.success-ring {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--auth-accent-green);
  animation: ringExpand 0.8s ease-out forwards;
  opacity: 0;
  animation-delay: 0.3s;
}

@keyframes ringExpand {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

.success-text {
  margin-top: 24px;
  color: var(--auth-text);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  animation: textFadeUp 0.5s ease 0.25s both;
}

.success-subtext {
  margin-top: 8px;
  color: var(--auth-text-muted);
  font-size: 0.9rem;
  animation: textFadeUp 0.5s ease 0.4s both;
}

@keyframes textFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Confetti dots */
.success-confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: confettiBurst 0.9s ease-out forwards;
  opacity: 0;
}

@keyframes confettiBurst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { opacity: 0; }
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 500px) {
  .auth-glass-card {
    padding: 32px 24px 28px;
    border-radius: 22px;
    margin: 0 8px;
  }

  .auth-header h1 {
    font-size: 1.5rem;
  }

  .auth-icon-ring {
    width: 56px;
    height: 56px;
  }

  .auth-icon-ring i {
    font-size: 1.25rem;
  }

  .brand-text {
    font-size: 1.35rem;
  }
}
