/* ============================================================
   BouwRegels — Login stylesheet
   Kleurpalet: staal-blauw #1a3550 | oranje #E8760A | grijs #6B7280
   ============================================================ */

:root {
  --br-navy:       #1a3550;
  --br-navy-deep:  #0f2035;
  --br-navy-mid:   #224066;
  --br-orange:     #E8760A;
  --br-orange-lt:  #F59340;
  --br-grey:       #6B7280;
  --br-grey-lt:    #9CA3AF;
  --br-grey-pale:  #E5E7EB;
  --br-white:      #F9FAFB;
  --br-ok-bg:      #dcfce7;
  --br-error-bg:   #fee2e2;
  --br-font:       'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --br-radius-md:  12px;
  --br-shadow-sm:  0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --br-transition: 0.18s cubic-bezier(.4,0,.2,1);
}

/* Layout shell */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
  background: var(--br-navy-deep);
  font-family: var(--br-font);
}

/* Linker panel — blauwdruk achtergrond */
.auth-stage {
  position: relative;
  overflow: hidden;
  padding: 48px 44px;
  display: grid;
  align-content: space-between;
  min-height: 100vh;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cdefs%3E%3Cpattern id='g' width='64' height='64' patternUnits='userSpaceOnUse'%3E%3Cpath d='M 64 0 L 0 0 0 64' fill='none' stroke='rgba(143%2C200%2C255%2C0.09)' stroke-width='1'/%3E%3C/pattern%3E%3Cpattern id='G' width='320' height='320' patternUnits='userSpaceOnUse'%3E%3Crect width='320' height='320' fill='url(%23g)'/%3E%3Cpath d='M 320 0 L 0 0 0 320' fill='none' stroke='rgba(143%2C200%2C255%2C0.20)' stroke-width='1.5'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23G)'/%3E%3C/svg%3E"),
    linear-gradient(165deg, var(--br-navy-deep) 0%, var(--br-navy-mid) 100%);
}

.auth-stage::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--br-orange), var(--br-orange-lt), transparent 80%);
  z-index: 2;
  pointer-events: none;
}

.auth-stage::after {
  content: "";
  position: absolute;
  right: 6%; bottom: 8%;
  width: 260px; height: 260px;
  border: 1.5px solid rgba(143,200,255,.13);
  border-radius: 20px;
  transform: rotate(-9deg);
  box-shadow: 0 0 0 20px rgba(143,200,255,.04), 0 0 0 40px rgba(143,200,255,.02);
  pointer-events: none;
  z-index: 0;
}

.auth-stage-top,
.auth-stage-bottom { position: relative; z-index: 1; }

/* Logo lockup */
.auth-lockup { display: flex; align-items: center; gap: 16px; }

.auth-logo {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(232,118,10,.15);
  border: 1px solid rgba(232,118,10,.28);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(232,118,10,.18);
}
.auth-logo svg { width: 32px; height: 32px; display: block; }

.auth-eyebrow {
  font-size: 11px; font-weight: 600;
  letter-spacing: .20em; text-transform: uppercase;
  color: rgba(143,200,255,.75);
  margin-bottom: 4px;
}

.brand-lockup-word {
  font-size: 28px; font-weight: 700;
  letter-spacing: -.02em; color: #fff; line-height: 1;
}

/* Heading & copy */
.auth-heading {
  margin: 32px 0 0;
  font-size: 48px; font-weight: 700;
  line-height: .97; letter-spacing: -.04em;
  color: #fff; max-width: 480px;
}

.auth-copy {
  margin: 18px 0 0;
  color: rgba(143,200,255,.68);
  font-size: 15px; line-height: 1.7;
  max-width: 520px;
}

/* Feature grid */
.auth-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.auth-mini {
  padding: 16px 18px;
  border-radius: var(--br-radius-md);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(143,200,255,.11);
  transition: background var(--br-transition), border-color var(--br-transition);
}
.auth-mini:hover { background: rgba(255,255,255,.07); border-color: rgba(143,200,255,.22); }

.auth-mini strong {
  display: block; font-size: 13px; font-weight: 600;
  color: #fff; margin-bottom: 6px;
}
.auth-mini strong::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--br-orange);
  margin-right: 8px; vertical-align: middle;
  position: relative; top: -1px;
}
.auth-mini span {
  display: block; font-size: 12px;
  color: rgba(143,200,255,.62); line-height: 1.55;
}

/* Blueprint-lijnen */
.auth-blueprint {
  margin-top: 24px; padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(143,200,255,.10);
  background: rgba(0,0,0,.18);
}
.auth-blueprint-lines { display: grid; gap: 9px; }

.auth-line {
  height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(143,200,255,.28), rgba(255,255,255,.04));
  position: relative; overflow: hidden;
}
.auth-line::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.13) 50%, transparent 100%);
  animation: br-shimmer 3.5s ease-in-out infinite;
}
.auth-line:nth-child(2)::after { animation-delay: .6s; }
.auth-line:nth-child(3)::after { animation-delay: 1.2s; }
.auth-line:nth-child(4)::after { animation-delay: 1.8s; }

@keyframes br-shimmer {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

.auth-line.short  { width: 40%; }
.auth-line.medium { width: 62%; }
.auth-line.long   { width: 86%; }

/* Rechter panel — login formulier */
.auth-side {
  display: grid; align-items: center;
  background: var(--br-white);
  padding: 48px 44px;
}

.auth-card { max-width: 420px; width: 100%; margin: 0 auto; }

.auth-card > .eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--br-orange);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.auth-card > .eyebrow::before {
  content: "";
  display: inline-block;
  width: 20px; height: 2px;
  background: var(--br-orange);
  border-radius: 1px; flex-shrink: 0;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 30px; font-weight: 700;
  letter-spacing: -.03em;
  color: var(--br-navy); line-height: 1.15;
}

.auth-card > p {
  margin: 0 0 28px;
  color: var(--br-grey);
  font-size: 14px; line-height: 1.65;
}

/* Formulier */
.auth-form { margin-top: 0; display: grid; gap: 0; }

.auth-form .field {
  padding: 0; border-radius: 0;
  background: transparent; border: none;
  box-shadow: none; margin-bottom: 18px;
  transition: none;
}
.auth-form .field:hover { background: transparent; border-color: transparent; transform: none; }
.auth-form .field:focus-within { background: transparent; border-color: transparent; box-shadow: none; transform: none; }

.auth-form .field label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 600;
  color: var(--br-navy);
  text-transform: none; letter-spacing: 0;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--br-font);
  font-size: 15px;
  color: var(--br-navy);
  background: #fff;
  border: 1.5px solid var(--br-grey-pale);
  border-radius: var(--br-radius-md);
  outline: none;
  box-shadow: var(--br-shadow-sm);
  transition: border-color var(--br-transition), box-shadow var(--br-transition);
  box-sizing: border-box;
}
.auth-form input[type="email"]:hover,
.auth-form input[type="password"]:hover { border-color: #CBD5E1; }

.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus {
  border-color: var(--br-navy);
  box-shadow: 0 0 0 3px rgba(26,53,80,.12), var(--br-shadow-sm);
}

.auth-form input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: var(--br-navy) !important;
  caret-color: var(--br-navy);
}

/* Submit knop */
.auth-button {
  width: 100%; margin-top: 8px;
  padding: 14px 20px;
  font-family: var(--br-font);
  font-size: 15px; font-weight: 700;
  letter-spacing: .01em;
  color: #fff; background: var(--br-navy);
  border: none; border-radius: var(--br-radius-md);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 14px rgba(26,53,80,.28);
  transition: background var(--br-transition), box-shadow var(--br-transition), transform var(--br-transition);
}
.auth-button:hover:not(:disabled) {
  background: var(--br-orange);
  box-shadow: 0 6px 20px rgba(232,118,10,.32);
  transform: translateY(-1px);
}
.auth-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(232,118,10,.22);
}
.auth-button[data-loading="true"] {
  background: var(--br-grey);
  cursor: not-allowed; pointer-events: none;
}
.auth-button[data-loading="true"]::before {
  content: "";
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: br-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes br-spin { to { transform: rotate(360deg); } }

.auth-button::after { content: none; }

/* Inline berichten */
#loginMessage {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--br-radius-md);
  font-size: 13.5px;
  font-family: var(--br-font);
  line-height: 1.55; font-weight: 500;
}

.auth-error {
  color: #991b1b;
  background: var(--br-error-bg);
  border: 1.5px solid rgba(220,38,38,.20);
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--br-radius-md);
  font-size: 13.5px;
  line-height: 1.55;
}
.auth-error::before { content: "\26A0\A0"; }

.auth-success {
  color: #14532d;
  background: var(--br-ok-bg);
  border: 1.5px solid rgba(22,163,74,.20);
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--br-radius-md);
  font-size: 13.5px;
  line-height: 1.55;
}
.auth-success::before { content: "\2713\A0"; }

/* Status & links */
.auth-status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(22,163,74,.25);
  background: rgba(22,163,74,.07);
  color: #15803d;
  font-size: 12px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
}
.auth-status::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
  animation: br-pulse 2s ease-in-out infinite;
}
@keyframes br-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .38; }
}

.auth-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; font-size: 13px; }
.auth-links a { color: var(--br-grey); text-decoration: none; transition: color var(--br-transition); }
.auth-links a:hover { color: var(--br-navy); text-shadow: none; }

.auth-footer { margin-top: 20px; color: var(--br-grey-lt); font-size: 12px; line-height: 1.6; }

/* Admin */
.admin-shell { min-height: 100vh; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.admin-card { padding: 24px; }
.admin-card h3 { margin: 0 0 10px; }
.admin-meta { color: var(--br-grey); font-size: 13px; line-height: 1.6; }

/* Responsive */
@media (max-width: 1080px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-stage { min-height: auto; padding: 36px 32px; }
  .auth-heading { font-size: 38px; }
  .auth-grid, .admin-grid { grid-template-columns: 1fr; }
  .auth-side { padding: 44px 32px; }
}

@media (max-width: 640px) {
  .auth-stage { padding: 28px 20px; }
  .auth-heading { font-size: 30px; }
  .auth-copy { font-size: 14px; }
  .auth-side { padding: 36px 20px; }
  .auth-card h1 { font-size: 26px; }
  .auth-grid { gap: 10px; }
}
