/* Fräspartner Serviceportal */
:root {
  --brand: #00aba0;        /* Türkis aus dem Logo (Linien, Akzente) */
  --brand-ink: #00776f;    /* dunkleres Türkis für Text & Buttons (ausreichender Kontrast) */
  --brand-soft: #e3f5f3;
  --ink: #34393b;          /* Anthrazit aus dem Logo */
  --ink-2: #5b6264;
  --muted: #7a8183;
  --line: #d9e0e0;
  --bg: #f4f6f6;
  --card: #ffffff;
  --ok: #2c7a3f;
  --ok-soft: #e7f4ea;
  --err: #b42318;
  --err-soft: #fdecea;
  --info-soft: #eef4f6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(30, 40, 42, .05), 0 6px 20px rgba(30, 40, 42, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
h1 { font-size: 1.65rem; line-height: 1.25; margin: 0 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
p { margin: .5rem 0; }
code { background: var(--info-soft); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; margin: 0; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 720px; }
main.wrap { flex: 1; padding-top: 32px; padding-bottom: 48px; }

/* Kopf & Fuß */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 84px; flex-wrap: wrap; }
.logo svg { display: block; height: 40px; width: auto; }
.account { display: flex; align-items: center; gap: 16px; font-size: .92rem; }
.account-name { color: var(--ink-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--ink); }
.site-footer { background: var(--ink); color: #cfd6d6; font-size: .88rem; border-top: 3px solid var(--brand); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.site-footer nav { display: flex; gap: 22px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin-bottom: 18px; }
.lead { color: var(--ink-2); margin-bottom: 1.2rem; }
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { color: var(--brand-ink); text-transform: uppercase; letter-spacing: .02em; }

/* Startseite */
.intro { margin-bottom: 26px; }
.intro h1 { font-size: 1.75rem; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 20px 0; }
.steps li { counter-increment: s; position: relative; padding: 2px 0 2px 46px; margin-bottom: 16px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .95rem;
}
.signature { font-weight: 600; margin-top: 1rem; }
.login-card { max-width: 440px; }
.below { margin: 14px 0 0; font-size: .95rem; }
.register-hint { padding-top: 14px; border-top: 1px solid var(--line); }

/* Formulare */
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.stack .field, .grid2 .field { margin-bottom: 0; }
.order-form .grid2 { margin-bottom: 16px; }
.field > span { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.hint { color: var(--muted); font-size: .84rem; font-weight: 400; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #c3cccc; border-radius: 7px;
  padding: 10px 12px; min-height: 44px; width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand-ink); margin: 3px 0 0; flex: none; transform: scale(1.15); }
input:disabled { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(0, 171, 160, .35); outline-offset: 1px; border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; line-height: 1.45; }
.check-strong span { font-weight: 600; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 4px 0 16px; }
.hp { position: absolute; left: -9999px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 10px 22px; border-radius: 8px; border: 2px solid var(--brand-ink);
  background: var(--brand-ink); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-outline { background: #fff; color: var(--brand-ink); }
.btn-outline:hover { background: var(--brand-soft); color: var(--ink); border-color: var(--brand-ink); }
.btn-block { width: 100%; }
.btn-large { min-height: 54px; font-size: 1.08rem; padding: 12px 34px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Hinweise */
.alert { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-info { background: var(--info-soft); border-color: #b9ced4; }
.alert-ok { background: var(--ok-soft); border-color: #9bcda7; }
.alert-err { background: var(--err-soft); border-color: #eba59f; color: #7a1a12; }

/* Passwortregeln */
.pw-rules { list-style: none; padding: 0; margin: -6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: .84rem; }
.pw-rules li { padding: 3px 10px 3px 24px; border-radius: 99px; background: var(--bg); color: var(--ink-2); position: relative; }
.pw-rules li::before { content: "○"; position: absolute; left: 9px; }
.pw-rules li.ok { background: var(--ok-soft); color: var(--ok); }
.pw-rules li.ok::before { content: "✓"; }

/* Auftragsformular */
.section-title { text-transform: uppercase; letter-spacing: .05em; font-size: .95rem; color: var(--ink); padding-bottom: 10px; border-bottom: 2px solid var(--brand); margin-bottom: 18px; }
.price-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 5px solid var(--brand); }
.price-card h2 { margin: 0; }
.price-card p { margin: 2px 0 0; }
.insurance { border: 0; padding: 0; margin: 4px 0 16px; }
.insurance-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 26px; }
.insurance-row > .check { min-width: 70px; }
.gkv-options { margin: 0 0 10px; }
.gkv-options.off { opacity: .45; }
.shape-sym { color: var(--brand-ink); font-size: 1.15em; }

/* Zahnschema */
.teeth { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 18px; overflow-x: auto; }
.jaw { display: grid; grid-template-columns: 1fr 1fr; }
.jaw-upper { border-bottom: 2px solid var(--brand); padding-bottom: 6px; }
.quadrant { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 0 6px; }
.quadrant:first-child { border-right: 2px solid var(--brand); }
.tooth { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.tooth-no { text-align: center; font-weight: 700; font-size: .85rem; color: var(--ink-2); padding: 3px 0; background: var(--bg); border-radius: 4px; }
.tooth select {
  -webkit-appearance: none; appearance: none; text-align: center; text-align-last: center;
  padding: 6px 0; min-height: 38px; font-weight: 700; color: var(--brand-ink); border-color: #c3cccc; cursor: pointer;
}
.tooth select.set { background: var(--brand-soft); border-color: var(--brand); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 18px; font-size: .84rem; color: var(--ink-2); }
.legend strong { display: inline-block; min-width: 26px; color: var(--ink); }
@media (max-width: 760px) {
  .jaw { grid-template-columns: 1fr; gap: 8px; }
  .quadrant:first-child { border-right: 0; }
  .quadrant::before { content: attr(data-label); grid-column: 1 / -1; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .jaw-lower .quadrant:first-child { order: 0; }
}

/* Upload */
.dropzone { position: relative; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.dropzone label {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 30px 16px; border: 2px dashed #a9c9c6; border-radius: var(--radius); background: #fbfdfd; color: var(--ink-2);
  transition: background .15s, border-color .15s;
}
.dropzone label strong { color: var(--brand-ink); font-size: 1.05rem; }
.dropzone label small { color: var(--muted); }
.dropzone.drag label, .dropzone:hover label { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input:focus-visible + label { outline: 3px solid rgba(0, 171, 160, .35); }
.file-list { list-style: none; padding: 0; margin: 14px 0 0; }
.file { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.file-remove { background: none; border: 0; color: var(--err); cursor: pointer; font: inherit; font-size: .85rem; text-decoration: underline; padding: 4px; }
.file-progress { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.file-progress > div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.file.done .file-meta::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.file.failed .file-name { color: var(--err); }
.file-error { grid-column: 1 / -1; color: var(--err); font-size: .85rem; }
.submit-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.submit-card .btn { margin-top: 8px; }

/* Bestätigung */
.confirm { text-align: center; }
.confirm h2 { margin-top: 22px; font-size: 1rem; }
.confirm-icon { width: 64px; height: 64px; border-radius: 50%; margin: 4px auto 14px; background: var(--brand) center/30px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.order-no { font-size: 1.2rem; margin: 14px 0; }
.plain-list { list-style: none; padding: 0; margin: 8px 0 16px; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.confirm .plain-list { display: inline-block; text-align: left; min-width: 60%; }

/* Rechtliches */
.legal h2 { font-size: 1.05rem; margin-top: 1.6rem; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 4px; }

/* Verwaltung */
.table { width: 100%; border-collapse: collapse; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.actions form + form { margin-left: 12px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--err-soft); color: var(--err); }

/* Abmelde-Warnung */
.timeout-dialog { position: fixed; inset: 0; background: rgba(30, 36, 38, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.timeout-dialog[hidden] { display: none; }
.timeout-box { background: #fff; border-radius: 12px; padding: 28px; max-width: 420px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); border-top: 5px solid var(--brand); }
.timeout-box h2 { margin-top: 0; }

@media (max-width: 560px) {
  h1, .intro h1 { font-size: 1.4rem; }
  .card { padding: 18px; }
  .logo svg { height: 32px; }
  .header-inner { min-height: 70px; padding-top: 8px; padding-bottom: 8px; }
  .account { width: 100%; justify-content: space-between; }
  .btn-large { width: 100%; }
  .quadrant { gap: 3px; padding: 0; }
  .tooth select { min-height: 34px; font-size: .8rem; }
  .tooth-no { font-size: .75rem; }
}
