/* ===== AUTH PAGINA'S (inloggen + registreren) ===== */

.auth-page {
  min-height: 100dvh;
  background: linear-gradient(135deg, #f0faf0 0%, #fff 60%);
  display: flex;
  flex-direction: column;
}

.auth-page .nav {
  border-bottom: none;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
}

.auth-card {
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  letter-spacing: -0.02em;
}

.auth-card h1 {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
  text-align: center;
}

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

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

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.form-group label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: #fff;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(61,139,55,0.1);
}

.form-input::placeholder {
  color: var(--color-text-faint);
}

/* Password toggle */
.form-group--password {
  position: relative;
}

.form-group--password .form-input {
  padding-right: var(--space-12);
}

.password-toggle {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-3);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0;
  transition: color var(--transition);
}

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

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

.forgot-link a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  transition: color var(--transition);
}

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

/* Checkbox */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-checkbox a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Submit button */
.auth-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-2);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  margin-block: var(--space-2);
}

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

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

.auth-switch a {
  color: var(--color-primary);
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .auth-card {
    padding: var(--space-8) var(--space-6);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===== AUTH MODAL (popup op elke pagina) ===== */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.auth-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.auth-modal {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  transform: translateY(12px) scale(0.99);
  transition: transform 0.22s ease;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.auth-overlay.is-open .auth-modal {
  transform: translateY(0) scale(1);
}

/* Sluit-knop */
.auth-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.375rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}

.auth-modal__close:hover {
  color: var(--color-text);
  background: var(--color-surface-muted);
}

/* Logo in modal */
.auth-modal__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

/* Tabs */
.auth-modal-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.auth-modal-tab {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem 0;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  position: relative;
  transition: color var(--transition);
}

.auth-modal-tab::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
  border-radius: 2px;
}

.auth-modal-tab.active {
  color: var(--color-primary);
}

.auth-modal-tab.active::after {
  transform: scaleX(1);
}

/* Formuliervelden in modal */
.auth-modal-field {
  margin-bottom: 1rem;
}

.auth-modal-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

.auth-modal-field input[type="text"],
.auth-modal-field input[type="email"],
.auth-modal-field input[type="password"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
  -webkit-appearance: none;
}

.auth-modal-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(61, 139, 55, 0.12);
}

/* Wachtwoord met oog-icoon */
.auth-modal-pw-wrap {
  position: relative;
}

.auth-modal-pw-wrap input {
  padding-right: 2.75rem !important;
}

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

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

/* Twee kolommen rij */
.auth-modal-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Checkbox akkoord */
.auth-modal-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1.5;
}

.auth-modal-check input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  width: 15px;
  height: 15px;
}

.auth-modal-check a {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-modal-check a:hover {
  text-decoration: underline;
}

/* Wachtwoord vergeten */
.auth-modal-forgot {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: 0;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  display: block;
  transition: color var(--transition);
  text-align: left;
}

.auth-modal-forgot:hover {
  color: var(--color-primary);
}

/* Submit-knop */
.auth-modal-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

/* Berichten (fout / succes) */
.auth-modal-msg {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.auth-modal-msg--error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.auth-modal-msg--success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* Reset-intro tekst */
.auth-modal-reset-intro {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.65;
}

/* Terug-link */
.auth-modal-back {
  display: block;
  text-align: center;
  margin-top: 0.875rem;
  font-size: var(--text-xs);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--color-text-muted);
  padding: 0;
  transition: color var(--transition);
}

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

/* === Nav: ingelogde staat === */
.nav__user {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

.btn--sm {
  padding: 0.375rem 0.875rem !important;
  font-size: var(--text-sm) !important;
}

@media (max-width: 480px) {
  .auth-modal {
    padding: 1.5rem 1.25rem;
    border-radius: 14px;
  }

  .auth-modal-field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
