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

:root {
  --primary: #008a4b;
  --primary-hover: #00733e;
  --primary-light: #e6f7ef;
  --primary-ring: rgba(0, 138, 75, 0.2);
  --accent-green: #008a4b;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border-color: #e5e7eb;
  --border-focus: #008a4b;
  --bg-page: #f9fbf9;
  --bg-card: #ffffff;
  --shadow-card: 0 15px 35px -5px rgba(0, 0, 0, 0.04), 0 0 1px 1px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

/* Background Decorative Curved Waves */
.bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-decorations svg {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0.75;
}

/* Main Container */
.auth-page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  padding: 44px 20px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Brand Header */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.brand-logo-wrap:hover {
  transform: translateY(-2px);
}

.brand-icon-svg {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 10px rgba(0, 138, 75, 0.16));
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #111827;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--primary);
  text-transform: uppercase;
  margin-top: 2px;
}

.welcome-heading {
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.welcome-heading span {
  color: var(--primary);
}

.welcome-subtext {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.5;
}

/* Auth Card */
.auth-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-xl);
  padding: 36px 36px 32px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.card-heading-group {
  text-align: center;
  margin-bottom: 26px;
}

.card-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

.form-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-left {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-icon-left svg {
  width: 18px;
  height: 18px;
}

.input-container input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 44px;
  font-size: 14px;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.input-container input::placeholder {
  color: #9ca3af;
  font-size: 13.5px;
}

.input-container input:hover {
  border-color: #d1d5db;
}

.input-container input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.input-container input:focus ~ .input-icon-left {
  color: var(--primary);
}

.input-btn-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.input-btn-toggle:hover {
  color: #4b5563;
  background-color: #f3f4f6;
}

.input-btn-toggle svg {
  width: 18px;
  height: 18px;
}

/* Remember me & Forgot Password */
.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
}

.remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  position: relative;
  background-color: #fff;
  transition: all 0.15s ease;
}

.custom-checkbox:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.custom-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.forgot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Submit Button */
.btn-submit {
  width: 100%;
  height: 48px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 138, 75, 0.22);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 4px;
}

.btn-submit:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(0, 138, 75, 0.3);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(1px);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0;
  color: #9ca3af;
  font-size: 12.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
  padding: 0 14px;
}

/* Social Buttons Grid (3 Columns on Desktop, exactly matching Screenshot 2) */
.social-login-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.btn-social {
  height: 46px;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-social:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-social svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Register / Switch Link */
.auth-switch-text {
  text-align: center;
  font-size: 13.5px;
  color: #4b5563;
}

.auth-switch-text button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 13.5px;
  transition: color 0.15s ease;
}

.auth-switch-text button:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* 4 Feature Badges Bar (Wide Horizontal Card) */
.features-bar {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}

.feature-icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  flex-shrink: 0;
}

.feature-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.feature-info {
  display: flex;
  flex-direction: column;
}

.feature-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.25;
}

.feature-desc {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

/* Security Banner (Placed Below 4 Badges, centered pill style) */
.security-banner {
  width: 100%;
  max-width: 480px;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.security-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  flex-shrink: 0;
}

.security-icon svg {
  width: 20px;
  height: 20px;
}

.security-text {
  display: flex;
  flex-direction: column;
}

.security-title {
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
}

.security-subtitle {
  font-size: 12px;
  color: #047857;
  margin-top: 1px;
}

/* Footer Copyright & Legal Links */
.auth-footer {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
  padding-bottom: 20px;
}

.footer-copy {
  margin: 0;
}

.footer-sep {
  color: #d1d5db;
}

.footer-link {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: #1e293b;
  color: #ffffff;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.toast.success {
  background: #065f46;
  border: 1px solid #059669;
}

.toast.error {
  background: #991b1b;
  border: 1px solid #dc2626;
}

.toast.info {
  background: #1e293b;
  border: 1px solid #334155;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* View states */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* Mobile Responsive Optimization (Edge-to-edge clean fit, no gaps) */
@media (max-width: 640px) {
  body {
    padding: 0;
    background-color: var(--bg-page);
  }

  .auth-page-container {
    width: 100%;
    max-width: 100%;
    padding: 20px 12px 28px;
  }

  .brand-header {
    margin-bottom: 20px;
  }

  .brand-logo-wrap {
    margin-bottom: 14px;
  }

  .brand-icon-svg {
    width: 54px;
    height: 54px;
    margin-bottom: 6px;
  }

  .welcome-heading {
    font-size: 22px;
  }

  .welcome-subtext {
    font-size: 13px;
  }

  .auth-card {
    width: 100%;
    padding: 22px 14px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(229, 231, 235, 0.85);
    margin-bottom: 16px;
  }

  .card-heading-group {
    margin-bottom: 20px;
  }

  .card-title {
    font-size: 18px;
  }

  .input-container input {
    height: 46px;
    font-size: 13.5px;
    padding: 0 38px 0 40px;
  }

  .btn-submit {
    height: 46px;
    font-size: 14.5px;
  }

  .social-login-group {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }

  .btn-social {
    height: 44px;
    font-size: 13px;
  }

  .features-bar {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 10px;
    border-radius: 16px;
    margin-bottom: 16px;
  }

  .feature-item {
    padding: 2px 4px;
    gap: 8px;
  }

  .feature-title {
    font-size: 11.5px;
  }

  .feature-desc {
    font-size: 10.5px;
  }

  .security-banner {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 24px;
  }

  .auth-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding-bottom: 16px;
  }

  .footer-sep {
    display: none;
  }
}
