/* ============================================================
   MediBook — Delt CSS for auth-sider
   (login, register, forgot, reset, 2fa-setup)
   ============================================================ */

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

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #0c1a2e 0%, #1a2f4a 50%, #0c1a2e 100%);
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
}

/* ── Kort ── */
.auth-card {
  width: 100%;
  max-width: 900px;
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.2);
  background: #fff;
}

/* ── Venstre panel ── */
.auth-side {
  flex: 0 0 320px;
  background: linear-gradient(175deg, #0c1a2e 0%, #162540 60%, #0e2038 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
}

.auth-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 80% 110%, rgba(47,128,237,.18) 0%, transparent 60%);
  pointer-events: none;
}

.auth-brand {
  position: relative;
}

.auth-brand-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.auth-brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #f1f5f9;
  line-height: 1.1;
}

.auth-brand-tagline {
  font-size: 0.78rem;
  color: #475569;
  margin-top: 8px;
  line-height: 1.4;
}

.auth-side-icon {
  position: relative;
  margin-top: 2.5rem;
  font-size: 4.5rem;
  color: rgba(47,128,237,.22);
  line-height: 1;
}

.auth-side-footer {
  position: relative;
  margin-top: auto;
  padding-top: 1.5rem;
}

/* Knapp i sidefeltet */
.auth-side-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,.12);
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
}
.auth-side-btn:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-color: rgba(255,255,255,.22);
  text-decoration: none;
}

.auth-copyright {
  font-size: 0.7rem;
  color: #334155;
  margin-top: 10px;
}

/* ── Høyre panel ── */
.auth-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 48px;
  background: #fff;
}

.auth-main h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1.4rem 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.auth-main h2 .bi {
  color: var(--brand-primary, #2f80ed);
  font-size: 1.1rem;
}

/* ── Skjema ── */
.auth-main .form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  display: block;
}

.auth-main .form-control,
.auth-main .form-select {
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.875rem;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: #fafbfc;
  color: #0f172a;
}

.auth-main .form-control:focus,
.auth-main .form-select:focus {
  border-color: var(--brand-primary, #2f80ed);
  box-shadow: 0 0 0 3px rgba(47,128,237,.15);
  background: #fff;
}

.auth-main .form-text {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 3px;
}

.auth-main .input-group .form-control {
  border-radius: 8px 0 0 8px;
}
.auth-main .input-group .input-group-text {
  border-radius: 0 8px 8px 0;
  border: 1.5px solid #e2e8f0;
  border-left: none;
  background: #f8fafc;
}

.mb-field { margin-bottom: 1rem; }

/* ── Hoved-CTA knapp ── */
.btn-auth-primary {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--brand-primary, #2f80ed);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(47,128,237,.3);
  text-decoration: none;
}
.btn-auth-primary:hover {
  background: var(--brand-accent, #1d4ed8);
  box-shadow: 0 4px 16px rgba(47,128,237,.4);
  color: #fff;
}
.btn-auth-primary:active {
  transform: scale(.99);
}

/* ── Sekundær lenke-knapp ── */
.btn-auth-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: 1.5px solid #e2e8f0;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-auth-ghost:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

/* ── Varsler ── */
.auth-alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
.auth-alert.danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.auth-alert.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.auth-alert.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

.auth-alert ul { margin: 4px 0 0 0; padding-left: 1.2em; }
.auth-alert ul li + li { margin-top: 2px; }

/* ── OTP-felt ── */
.otp-input {
  letter-spacing: 0.4em;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ── Hjelpelenker ── */
.auth-help {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 1rem;
  line-height: 1.5;
}

.auth-link {
  color: var(--brand-primary, #2f80ed);
  text-decoration: none;
  font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

.auth-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9rem;
}

/* ── QR-blokk (2FA) ── */
.qr-block {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 1.25rem;
}

.qr-block img {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.secret-key {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.12em;
  word-break: break-all;
}

/* ── Brreg-feedback ── */
#brreg-result .bi { vertical-align: -2px; }

/* ── Mobil ── */
@media (max-width: 700px) {
  body { padding: 0; align-items: stretch; background: #fff; }
  .auth-card {
    flex-direction: column;
    border-radius: 0;
    box-shadow: none;
    min-height: 100dvh;
  }
  .auth-side {
    flex: none;
    padding: 24px;
  }
  .auth-side-icon { display: none; }
  .auth-main { padding: 28px 24px; justify-content: flex-start; padding-top: 32px; }
}
