/* ============ Auth Design — St-Georg-Hospital ============ */
/* Accessibility-first login/registration/forgotten flow     */

/* Self-hosted fonts — no external requests */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/public/fonts/atkinson-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/public/fonts/atkinson-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/public/fonts/sourceserif4-500-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/public/fonts/sourceserif4-600.woff2') format('woff2');
}

/* ============ Tokens ============ */
:root {
  --auth-bg:          #f7f5f0;
  --auth-surface:     #ffffff;
  --auth-ink:         #13221f;
  --auth-ink-2:       #3b4a47;
  --auth-ink-3:       #6b7977;
  --auth-line:        #dcd7ca;
  --auth-line-strong: #b7b0a0;
  --auth-primary:     #3c6f97;
  --auth-primary-ink: #ffffff;
  --auth-primary-hov: #305a7c;
  --auth-focus:       #ffb84d;
  --auth-success:     #2e6e3f;
  --auth-danger:      #b3261e;
  --auth-info-bg:     #eef3f3;
  --auth-warn-bg:     #fff3e0;
  --auth-err-bg:      #fde8e6;
  --auth-ok-bg:       #e7f1e9;

  --auth-pad:     22px;
  --auth-gap:     14px;
  --auth-input-h: 58px;
  --auth-btn-h:   56px;
  --auth-radius:  14px;

  --auth-fs-body:  18px;
  --auth-fs-lg:    24px;
  --auth-fs-xl:    32px;
  --auth-fs-2xl:   44px;
  --auth-fs-3xl:   56px;

  --auth-font-sans:    'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --auth-font-serif:   'Source Serif 4', Georgia, serif;
  --auth-font-heading: var(--auth-font-serif);
}

/* ============ Shell ============ */
.auth-shell {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--auth-bg);
  font-family: var(--auth-font-sans);
  font-size: var(--auth-fs-body);
  line-height: 1.5;
  color: var(--auth-ink);
  -webkit-font-smoothing: antialiased;
}
.auth-shell.auth-shell-single {
  grid-template-columns: 1fr;
}

/* ============ Photo pane ============ */
.auth-photo {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(22, 45, 62, 0.55) 0%, rgba(22, 45, 62, 0.35) 45%, rgba(22, 45, 62, 0.65) 100%),
    url('/public/images/st-georg-hospital-eingang.jpeg') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--auth-pad);
  color: #fff;
}
.auth-photo::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.04) 0 2px,
      transparent 2px 14px),
    radial-gradient(ellipse at 30% 40%, rgba(255,255,255,0.12), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(20,35,49,0.45), transparent 60%);
  pointer-events: none;
}
.auth-photo-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  border: 1px dashed rgba(255,255,255,0.35);
  padding: 10px 18px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}
.auth-brand {
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 2;
}
.auth-brand-mark {
  width: 52px; height: 52px;
  background: #fff;
  color: var(--auth-primary);
  border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--auth-font-heading);
  font-weight: 700;
  font-size: 28px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.auth-brand-name {
  font-family: var(--auth-font-heading);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}
.auth-brand-sub {
  font-size: 15px;
  opacity: 0.7;
  font-family: var(--auth-font-sans);
}
.auth-photo-quote {
  position: relative; z-index: 2;
  max-width: 480px;
  font-family: var(--auth-font-heading);
  font-size: var(--auth-fs-xl);
  line-height: 1.3;
  font-weight: 500;
  font-style: italic;
}
.auth-photo-quote .attr {
  display: block;
  font-family: var(--auth-font-sans);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 16px;
  letter-spacing: 0.02em;
}
.auth-photo-foot {
  position: relative; z-index: 2;
  font-size: 13px;
  opacity: 0.6;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex; justify-content: space-between;
}

/* ============ Form pane ============ */
.auth-form-pane {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
  background: var(--auth-bg);
}
.auth-form-header {
  padding: var(--auth-pad) var(--auth-pad) 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-help-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--auth-surface);
  border: 2px solid var(--auth-line-strong);
  color: var(--auth-ink);
  padding: 12px 18px;
  border-radius: 999px;
  font-family: var(--auth-font-sans);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms;
  text-decoration: none;
}
.auth-help-btn:hover { background: #eee9dd; color: var(--auth-ink); }
.auth-help-qmark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--auth-primary); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px;
  line-height: 1;
}
.auth-back-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--auth-surface);
  border: 2px solid var(--auth-line-strong);
  color: var(--auth-ink);
  padding: 12px 18px;
  border-radius: var(--auth-radius);
  font-family: var(--auth-font-sans);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms;
  text-decoration: none;
}
.auth-back-btn:hover { background: #eee9dd; color: var(--auth-ink); }

.auth-form-body {
  flex: 1;
  padding: 28px var(--auth-pad) var(--auth-pad);
  display: flex;
  flex-direction: column;
  max-width: 620px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
.auth-form-body-wide {
  max-width: 900px;
}

.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--auth-ink-3);
  margin-bottom: 12px;
}
.auth-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--auth-primary);
  display: inline-block;
}
.auth-title {
  font-family: var(--auth-font-heading);
  font-size: var(--auth-fs-3xl);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--auth-ink);
}
.auth-subtitle {
  font-size: var(--auth-fs-lg);
  color: var(--auth-ink-2);
  margin-bottom: 22px;
  max-width: 38ch;
  line-height: 1.4;
}

/* Legal pages (Datenschutz / Impressum) */
.auth-legal {
  background: var(--auth-surface);
  border: 2px solid var(--auth-line);
  border-radius: var(--auth-radius);
  padding: 20px;
  line-height: 1.6;
}
.auth-legal h2 {
  font-family: var(--auth-font-heading);
  font-size: 28px;
  margin: 26px 0 8px;
  line-height: 1.2;
}
.auth-legal h2:first-child {
  margin-top: 0;
}
.auth-legal p {
  margin: 0 0 14px;
  color: var(--auth-ink-2);
}
.auth-legal ul {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--auth-ink-2);
}
.auth-legal li {
  margin-bottom: 6px;
}
.auth-legal a {
  color: var(--auth-primary);
}

.auth-help-faq .faq-item {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--auth-line);
}
.auth-help-faq .faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.auth-help-faq .faq-item h2 {
  margin-top: 0;
}

/* ============ Form fields ============ */
.auth-field {
  display: flex; flex-direction: column;
  margin-bottom: var(--auth-gap);
}
.auth-field-label {
  font-size: var(--auth-fs-lg);
  font-weight: 700;
  color: var(--auth-ink);
  margin-bottom: 8px;
  line-height: 1.2;
}
.auth-field-hint {
  font-size: 17px;
  color: var(--auth-ink-2);
  margin-bottom: 12px;
  line-height: 1.4;
}
.auth-input-wrap {
  position: relative;
  display: flex; align-items: stretch;
}
.auth-input {
  flex: 1;
  height: var(--auth-input-h);
  padding: 0 20px;
  font-family: var(--auth-font-sans);
  font-size: var(--auth-fs-lg);
  color: var(--auth-ink);
  background: var(--auth-surface);
  border: 2px solid var(--auth-line-strong);
  border-radius: var(--auth-radius);
  transition: border-color 120ms, box-shadow 120ms;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.auth-input::placeholder { color: var(--auth-ink-3); }
.auth-input:hover { border-color: var(--auth-ink-3); }
.auth-input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px rgba(60,111,151,0.18);
}
.auth-input:focus-visible {
  outline: 4px solid var(--auth-focus);
  outline-offset: 2px;
}
.auth-input.has-icon  { padding-left: 58px; }
.auth-input.has-trail { padding-right: 148px; }

.auth-input-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; color: var(--auth-ink-3);
  pointer-events: none;
  display: flex; align-items: center;
}
.auth-input-icon svg { width: 24px; height: 24px; }

.auth-input-trail {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--auth-primary);
  font-family: var(--auth-font-sans);
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  border-radius: 8px;
  height: calc(var(--auth-input-h) - 12px);
  white-space: nowrap;
  line-height: 1;
}
.auth-input-trail:hover { background: var(--auth-info-bg); }
.auth-input-trail svg { width: 22px; height: 22px; flex-shrink: 0; }
.auth-input-trail .pw-show:not([hidden]),
.auth-input-trail .pw-hide:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-field.is-error .auth-input {
  border-color: var(--auth-danger);
  background: var(--auth-err-bg);
}
.auth-field-msg {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 10px;
  font-size: 17px;
  color: var(--auth-danger);
  font-weight: 600;
  line-height: 1.4;
}
.auth-field-msg svg { flex-shrink: 0; margin-top: 2px; width: 20px; height: 20px; }

/* Password strength */
.auth-pw-meter {
  display: flex; gap: 6px; margin-top: 12px;
}
.auth-pw-meter .seg {
  flex: 1; height: 8px; border-radius: 4px; background: var(--auth-line);
  transition: background 200ms;
}
.auth-pw-meter .seg.on-1 { background: #d96a4a; }
.auth-pw-meter .seg.on-2 { background: #e0a23a; }
.auth-pw-meter .seg.on-3 { background: var(--auth-success); }
.auth-pw-meter-text {
  font-size: 16px; color: var(--auth-ink-2); margin-top: 8px;
}

/* Checkbox */
.auth-check {
  display: inline-flex; align-items: flex-start; gap: 14px;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}
.auth-check input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.auth-check-box {
  width: 32px; height: 32px; border-radius: 8px;
  border: 2.5px solid var(--auth-line-strong);
  background: var(--auth-surface);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all 120ms;
  margin-top: 2px;
}
.auth-check input[type="checkbox"]:checked + .auth-check-box {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
}
.auth-check-box svg { opacity: 0; color: #fff; width: 20px; height: 20px; }
.auth-check input[type="checkbox"]:checked + .auth-check-box svg { opacity: 1; }
.auth-check:hover .auth-check-box { border-color: var(--auth-primary); }
.auth-check input[type="checkbox"]:focus-visible + .auth-check-box {
  outline: 4px solid var(--auth-focus);
  outline-offset: 3px;
}
.auth-check-label {
  font-size: var(--auth-fs-body);
  color: var(--auth-ink);
  line-height: 1.4;
  padding-top: 4px;
}
.auth-check-label a { color: var(--auth-primary); }

/* ============ Buttons ============ */
.auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: var(--auth-btn-h);
  padding: 0 28px;
  border-radius: var(--auth-radius);
  border: 2px solid transparent;
  font-family: var(--auth-font-sans);
  font-size: var(--auth-fs-lg);
  font-weight: 700;
  cursor: pointer;
  transition: all 120ms;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}
.auth-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.auth-btn-primary {
  background: var(--auth-primary);
  color: #fff;
  border-color: var(--auth-primary);
  box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}
.auth-btn-primary:hover { background: var(--auth-primary-hov); border-color: var(--auth-primary-hov); color: #fff; }
.auth-btn-ghost {
  background: transparent;
  color: var(--auth-ink);
  border-color: var(--auth-line-strong);
}
.auth-btn-ghost:hover { background: var(--auth-surface); border-color: var(--auth-ink-2); color: var(--auth-ink); }
.auth-btn-link {
  background: transparent;
  border: none;
  color: var(--auth-primary);
  font-family: var(--auth-font-sans);
  font-weight: 700;
  font-size: var(--auth-fs-body);
  cursor: pointer;
  padding: 10px 4px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  height: auto;
}
.auth-btn-link:hover { color: var(--auth-primary-hov); }
.auth-btn-block { width: 100%; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Focus rings */
.auth-btn:focus-visible,
.auth-back-btn:focus-visible,
.auth-help-btn:focus-visible,
.auth-input-trail:focus-visible {
  outline: 4px solid var(--auth-focus);
  outline-offset: 3px;
}

.auth-action-row {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 4px;
}
.auth-action-aux {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 20px 0 14px;
  color: var(--auth-ink-3);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--auth-line);
}

/* CTA card */
.auth-cta-card {
  background: var(--auth-surface);
  border: 2px solid var(--auth-line);
  border-radius: var(--auth-radius);
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}
.auth-cta-card .text { line-height: 1.35; }
.auth-cta-card .text strong {
  font-size: var(--auth-fs-body); color: var(--auth-ink); display: block; margin-bottom: 4px;
}
.auth-cta-card .text span { font-size: 17px; color: var(--auth-ink-2); }

/* ============ Alerts ============ */
.auth-alert {
  display: flex; gap: 14px;
  padding: 18px 20px;
  border-radius: var(--auth-radius);
  margin-bottom: 16px;
  border: 2px solid;
  font-size: var(--auth-fs-body);
  line-height: 1.4;
}
.auth-alert svg { flex-shrink: 0; margin-top: 2px; width: 26px; height: 26px; }
.auth-alert-body { flex: 1; }
.auth-alert-title { font-weight: 700; margin-bottom: 4px; color: var(--auth-ink); }
.auth-alert.info  { background: var(--auth-info-bg); border-color: #c9dadb; color: var(--auth-ink); }
.auth-alert.warn  { background: var(--auth-warn-bg); border-color: #f0c98c; color: var(--auth-ink); }
.auth-alert.err   { background: var(--auth-err-bg);  border-color: #e8a8a4; color: var(--auth-ink); }
.auth-alert.ok    { background: var(--auth-ok-bg);   border-color: #a8c9b2; color: var(--auth-ink); }
.auth-alert.err svg { color: var(--auth-danger); }
.auth-alert.ok  svg { color: var(--auth-success); }

/* Alert list */
.auth-alert ol {
  margin: 0; padding-left: 20px; line-height: 1.8;
}

/* ============ Success screen ============ */
.auth-success-badge {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--auth-success);
  color: #fff;
  display: grid; place-items: center;
  margin-bottom: 28px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.08);
}
.auth-success-badge svg { width: 48px; height: 48px; }

.auth-kv {
  display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px;
  padding: 20px 24px;
  border-left: 4px solid var(--auth-primary);
  background: var(--auth-info-bg);
  border-radius: 0 var(--auth-radius) var(--auth-radius) 0;
  margin: 24px 0;
  font-size: 17px;
}
.auth-kv dt { color: var(--auth-ink-3); font-size: 16px; font-weight: 600; }
.auth-kv dd { margin: 0; color: var(--auth-ink); font-family: monospace; }

.auth-next-steps {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 36px;
  padding: 24px;
  background: var(--auth-surface);
  border: 2px solid var(--auth-line);
  border-radius: var(--auth-radius);
}
.auth-next-steps h3 {
  font-family: var(--auth-font-sans);
  font-size: var(--auth-fs-body);
  color: var(--auth-ink-3);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.auth-next-steps .step-line {
  font-size: var(--auth-fs-lg);
  color: var(--auth-ink);
}

/* ============ Footer ============ */
.auth-form-foot {
  padding: 14px var(--auth-pad);
  display: flex; gap: 24px; flex-wrap: wrap;
  font-size: 16px;
  color: var(--auth-ink-3);
  border-top: 1px solid var(--auth-line);
  background: var(--auth-bg);
  margin-top: auto;
}
.auth-form-foot a {
  color: var(--auth-ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--auth-line-strong);
}
.auth-form-foot a:hover { color: var(--auth-primary); text-decoration-color: var(--auth-primary); }
.auth-form-foot .copy { margin-right: auto; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-photo {
    display: none;
  }
}

@media (max-width: 560px) {
  .auth-cta-card { flex-direction: column; align-items: flex-start; }
  .auth-action-aux { flex-direction: column; align-items: flex-start; }
  :root {
    --auth-fs-3xl: 40px;
    --auth-fs-2xl: 32px;
  }
}

@media (max-height: 1080px) {
  .auth-shell {
    height: 100vh;
  }

  :root {
    --auth-fs-body: 17px;
    --auth-fs-lg: 20px;
    --auth-fs-3xl: 48px;
    --auth-fs-2xl: 38px;
    --auth-input-h: 52px;
    --auth-btn-h: 52px;
  }

  .auth-photo {
    padding: 20px;
  }

  .auth-photo-quote {
    font-size: 24px;
    line-height: 1.2;
  }

  .auth-photo-quote .attr,
  .auth-photo-foot {
    display: none;
  }

  .auth-form-header {
    padding: 18px 20px 0;
  }

  .auth-form-body {
    padding-top: 20px;
    max-width: 560px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .auth-subtitle {
    font-size: 18px;
    margin-bottom: 18px;
  }

  .auth-eyebrow,
  .auth-field-hint {
    display: none;
  }

  .auth-field {
    margin-bottom: 12px;
  }

  .auth-field-hint {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .auth-check {
    display: none;
  }

  .auth-check-box {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    margin-top: 0;
  }

  .auth-check-label {
    font-size: 16px;
    line-height: 1.25;
  }

  .auth-action-row {
    gap: 12px;
  }

  .auth-divider {
    margin: 10px 0 8px;
    font-size: 13px;
  }

  .auth-cta-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .auth-cta-card .text strong {
    margin-bottom: 0;
    font-size: 16px;
  }

  .auth-cta-card .text span {
    display: none;
  }

  .auth-cta-card .auth-btn-ghost {
    height: 40px;
    font-size: 14px;
    padding: 0 12px;
  }

  .auth-form-foot {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 15px;
    gap: 16px;
  }

  .auth-help-btn,
  .auth-back-btn {
    padding: 8px 12px;
    font-size: 15px;
    height: 42px;
  }

  .auth-help-qmark {
    width: 22px;
    height: 22px;
    font-size: 14px;
  }
}

