/* Frame Reveal — gedeelde auth-stijlen (login, registreren, wachtwoord vergeten) */

:root {
  --dark: #0C0B19;
  --darkgray: #6B6880;
  --gray: #9E9CB1;
  --lightgray: #D2D0E1;
  --primary-10: #F2F0FF;
  --primary-15: #EBE9FF;
  --primary-25: #E5E1FF;
  --primary-50: #BDB4FF;
  --primary-100: #7C6AFF;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
}

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

html, body { height: 100%; }

body {
  background: var(--primary-25);
  color: var(--dark);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* Viewfinder hoeken */
.corner {
  position: absolute;
  width: 40px; height: 40px;
  z-index: 3; pointer-events: none;
}
.corner.tl { top: 32px; left: 32px;  border-top: 2px solid var(--primary-50); border-left: 2px solid var(--primary-50); }
.corner.tr { top: 32px; right: 32px; border-top: 2px solid var(--primary-50); border-right: 2px solid var(--primary-50); }
.corner.bl { bottom: 32px; left: 32px; border-bottom: 2px solid var(--primary-50); border-left: 2px solid var(--primary-50); }
.corner.br { bottom: 32px; right: 32px; border-bottom: 2px solid var(--primary-50); border-right: 2px solid var(--primary-50); }

/* Section met radial gradient */
.auth-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: min(7vw, 2.5rem);
  padding: 0 min(5vw, 2.5rem);
  background: radial-gradient(100vh 100vh at 50% 100vh, #BDB4FF 0%, #E5E1FF 100%);
  overflow: hidden;
}
/* Modifier voor langere formulieren (registreren) die verticaal ruimte nodig hebben */
.auth-section.is-scrollable { padding: 3rem min(5vw, 2.5rem); }

.auth-logo {
  margin-top: -4rem;
  height: 44px;
  width: auto;
  z-index: 2;
  opacity: 0;
  animation: fadeUp 0.7s ease 0.1s forwards;
}
/* Modifier — geen negatieve marge wanneer de card te groot is (registreren) */
.auth-logo.is-flush { margin-top: 0; }

/* Card */
.auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 25rem;
  background: var(--primary-10);
  border: 1px solid var(--lightgray);
  border-radius: 16px;
  padding: min(10vw, 3rem) min(7vw, 2.5rem);
  box-shadow: 0 0 32px 0 rgba(124, 106, 255, 0.25);
  opacity: 0;
  animation: fadeUp 0.7s ease 0.2s forwards;
  z-index: 2;
}
.auth-card.is-compact { gap: 1.5rem; }

.auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.auth-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
  color: var(--dark);
}
.auth-title em {
  font-style: italic;
  color: var(--primary-100);
}

.auth-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--darkgray);
  text-align: center;
}

/* Body-wrapper — gap tussen alerts/form */
.auth-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
}

/* Form */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.form-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04125rem;
  text-transform: uppercase;
  color: var(--darkgray);
}

.field-error {
  display: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #dc2626;
  line-height: 1.3;
  text-align: right;
}
.form-group.has-error .form-input { border-color: #dc2626; }
.form-group.has-error .form-input:focus { box-shadow: 0 0 0 1px #dc2626; }
.form-group.has-error .field-error { display: block; }

.form-input {
  width: 100%;
  background: var(--primary-15);
  border: 1px solid var(--lightgray);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--darkgray);
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input::placeholder { color: var(--gray); }
.form-input:focus {
  border-color: var(--primary-100);
  box-shadow: 0 0 0 1px var(--primary-100);
}

/* Password veld + oog-icoon */
.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 44px; }
.pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 0;
  color: var(--gray);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.pw-toggle:hover { color: var(--darkgray); }

/* Rij met remember + link (login) */
.form-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

/* Checkbox — remember (login) en terms (registreren) */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--darkgray);
}
.form-check input[type="checkbox"],
.form-terms input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 0.25rem;
  border: 1px solid var(--lightgray);
  background: var(--primary-15);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
}
.form-check input[type="checkbox"]::before,
.form-terms input[type="checkbox"]::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 0.15rem;
  transform: scale(0);
  transition: transform 0.1s ease;
  background: var(--primary-100);
}
.form-check input[type="checkbox"]:checked::before,
.form-terms input[type="checkbox"]:checked::before { transform: scale(1); }

.form-link {
  font-size: 12px;
  color: var(--primary-100);
  text-decoration: none;
  transition: text-decoration 0.2s;
}
.form-link:hover { text-decoration: underline; }

/* Terms — registreren */
.form-terms {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
}
.form-terms p {
  font-size: 12px;
  color: var(--darkgray);
  line-height: 1.4;
  flex: 1;
}
.form-terms a {
  color: var(--darkgray);
  text-decoration: underline;
  transition: color 0.2s;
}
.form-terms a:hover { color: var(--primary-100); }

/* Actions */
.auth-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

/* Button */
.btn-auth {
  width: 100%;
  background: var(--primary-100);
  color: var(--primary-10);
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 0 32px 0 rgba(124, 106, 255, 0.25);
}
.btn-auth:hover { opacity: 0.9; }
.btn-auth:active { transform: scale(0.98); }
.btn-auth:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-auth:disabled:hover { opacity: 0.5; }

/* Alerts */
.alert {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-error   { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.15); color: #dc2626; }
.alert-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.15); color: #0d8a5e; }
.alert-notice  { background: var(--primary-15);     border: 1px solid var(--primary-50);    color: var(--dark); }
.alert-notice svg { color: var(--primary-100); margin-top: 2px; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Footer-link onder formulier */
.auth-footer {
  font-size: 14px;
  color: var(--darkgray);
  text-align: center;
}
.auth-footer a {
  color: var(--primary-100);
  text-decoration: none;
  transition: text-decoration 0.2s;
}
.auth-footer a:hover { text-decoration: underline; }

/* Inline link-button (bv. "Opnieuw versturen" in lopende tekst) */
.link-inline {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--primary-100);
  cursor: pointer;
  text-decoration: none;
  transition: text-decoration 0.2s, opacity 0.2s;
}
.link-inline:hover { text-decoration: underline; }
.link-inline:disabled { opacity: 0.5; cursor: not-allowed; text-decoration: none; }

/* Terug-link (wachtwoord vergeten) */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--primary-100);
  text-decoration: none;
  transition: text-decoration 0.2s;
}
.back-link:hover { text-decoration: underline; }
.back-link svg { width: 14px; height: 14px; }

/* 2FA (login) */
.totp-input {
  text-align: center;
  font-size: 24px;
  letter-spacing: 0.3em;
  font-family: var(--sans), monospace;
  color: var(--dark);
}
.cancel-link {
  font-size: 14px;
  color: var(--primary-100);
  text-decoration: none;
}
.cancel-link:hover { text-decoration: underline; }

/* Animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Voorkom iOS zoom bij focus */
@media (max-width: 640px) {
  input[type="email"],
  input[type="password"],
  input[type="text"] { font-size: 16px !important; }
}

/* Responsive */
@media (max-width: 640px) {
  .auth-section { gap: 1.5rem; padding: 0 1.25rem; }
  .auth-section.is-scrollable { padding: 3rem 1.25rem; }
  .auth-logo { margin-top: -2rem; height: 44px; }
  .auth-logo.is-flush { margin-top: 0; }
  .auth-card { padding: 2rem 1.5rem; gap: 1.5rem; }
  .auth-title { font-size: 1.875rem; }
  .auth-sub { font-size: 14px; }
  .auth-body { gap: 0.875rem; }
  .auth-actions { gap: 1.25rem; }
  .corner { width: 24px; height: 24px; }
  .corner.tl { top: 16px; left: 16px; }
  .corner.tr { top: 16px; right: 16px; }
  .corner.bl { bottom: 16px; left: 16px; }
  .corner.br { bottom: 16px; right: 16px; }
}

@media (max-width: 380px) {
  .corner { display: none; }
  .form-row { flex-wrap: wrap; gap: 12px; }
}
