/*
 * Geführte Anmeldung „Partner werden“ (views/letzdine/partner/start.php). Baut auf partner.css auf (Farben, Schrift,
 * Knöpfe, Sprache, Hell/Dunkel). Mit JavaScript (html.ps-js) eine Frage je Schritt, ohne alle Fragen untereinander.
 */
:root {
    --danger: #c4312b;
    --danger-soft: rgba(196, 49, 43, .08);
    --ring: rgba(11, 119, 180, .22);
    --ps-bar: 56px;
}
:root[data-theme="dark"] {
    --danger: #ff6b61;
    --danger-soft: rgba(255, 107, 97, .12);
    --ring: rgba(47, 176, 234, .3);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) { --danger: #ff6b61; --danger-soft: rgba(255, 107, 97, .12); --ring: rgba(47, 176, 234, .3); }
}

body.ps { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.ps-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ps [hidden] { display: none !important; }
.ps-trap { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Leiste mit Fortschritt ---------- */
.ps-bar {
    position: sticky; top: 0; z-index: 60; background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.ps-bar-in { max-width: 1200px; height: var(--ps-bar); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 8px; }
.ps-bar-end { display: flex; align-items: center; gap: 4px; }
.ps-close .pp-ico { width: 18px; height: 18px; }
.ps-progress { height: 2px; background: var(--line); }
.ps-progress span {
    display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center;
    transition: transform .5s var(--ease-out);
}

/* ---------- Raster: Fragen links, Vorschau rechts ---------- */
.ps-main { flex: 1; padding: 40px var(--gutter) 96px; }
.ps-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 64px; }
.ps-form, .ps-done { width: 100%; max-width: 640px; }
.ps-preview { display: none; }
@media (min-width: 1024px) {
    .ps-main { padding-top: 72px; }
    .ps-grid { grid-template-columns: minmax(0, 640px) minmax(0, 360px); justify-content: space-between; align-items: start; }
    .ps-preview { display: block; position: sticky; top: calc(var(--ps-bar) + 48px); }
}

/* ---------- Schritte ---------- */
.ps-js .ps-step:not(.is-current) { display: none; }
html:not(.ps-js) .ps-step { padding-block: 40px; box-shadow: 0 -1px 0 var(--line); }
html:not(.ps-js) .ps-step:first-of-type { box-shadow: none; padding-top: 0; }
html:not(.ps-js) [data-ps-next], html:not(.ps-js) .ps-small, html:not(.ps-js) .ps-count { display: none; }
.ps-step { min-width: 0; }

.ps-kicker { margin: 0 0 16px; color: var(--accent); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ps-title {
    margin: 0; max-width: 16ch; font-size: clamp(40px, 6vw, 60px); line-height: 1.04; font-weight: 600; letter-spacing: -.035em;
    text-wrap: balance;
}
.ps-title:focus, .ps-q:focus { outline: none; }
.ps-lead { margin: 20px 0 0; max-width: 34em; color: var(--muted); font-size: clamp(18px, 2vw, 20px); line-height: 1.5; text-wrap: pretty; }
.ps-points { margin: 32px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.ps-points li { display: flex; align-items: flex-start; gap: 12px; font-size: 17px; line-height: 1.4; }
.ps-points .pp-ico { margin-top: 2px; width: 20px; height: 20px; color: var(--ok); }
.ps-intro-go { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.ps-small { margin: 0; max-width: 24em; color: var(--faint); font-size: 14px; line-height: 1.4; }
.ps-talk { margin: 48px 0 0; padding-top: 24px; box-shadow: 0 -1px 0 var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; color: var(--muted); font-size: 15px; }
.ps-talk a { display: inline-flex; align-items: center; gap: 8px; color: var(--text) !important; text-decoration: none; font-weight: 500; }
.ps-talk a:hover { color: var(--accent) !important; }
.ps-talk .pp-ico { color: var(--accent); }

.ps-count { margin: 0 0 16px; color: var(--faint); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ps-q { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 600; letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere; }
.ps-hint { margin: 12px 0 0; max-width: 34em; color: var(--muted); font-size: 17px; line-height: 1.5; text-wrap: pretty; }
.ps-meta { margin: 8px 0 0; color: var(--faint); font-size: 14px; line-height: 1.4; }

/* ---------- Felder ---------- */
.ps-label { display: block; margin: 32px 0 8px; font-size: 15px; font-weight: 500; }
.ps-hint + .ps-label, .ps-hint + .ps-chips, .ps-hint + .ps-options, .ps-hint + .ps-drop { margin-top: 32px; }
.ps-opt { margin-inline-start: 8px; padding: 2px 8px; border-radius: 999px; background: var(--tile-2); color: var(--muted); font-size: 12px; font-weight: 500; }
.ps-input {
    display: block; width: 100%; min-height: 56px; margin: 0; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px;
    background: var(--tile); color: var(--text); font: 400 18px/1.4 var(--font); letter-spacing: -.01em;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ps-input::placeholder { color: var(--faint); opacity: 1; }
.ps-input:hover { border-color: var(--faint); }
.ps-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.ps-input-xl { min-height: 64px; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.ps-textarea { min-height: 128px; resize: vertical; }
.ps-input[aria-invalid="true"] { border-color: var(--danger); }
.ps-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--danger-soft); }
.ps-input-icon { position: relative; }
.ps-input-icon > .pp-ico { position: absolute; inset-inline-start: 16px; top: 19px; color: var(--faint); pointer-events: none; }
.ps-input-icon > .ps-input { padding-inline-start: 46px; }
.ps-pair { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .ps-pair { grid-template-columns: 1fr 1fr; } }
.ps-error { margin: 8px 0 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.ps-alert { margin: 0 0 24px; padding: 14px 16px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); font-size: 15px; line-height: 1.45; }
.ps-step .ps-alert { margin: 24px 0 0; }

/* Küchen: Chips zum Antippen */
.ps-chips { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ps-chip { position: relative; cursor: pointer; }
.ps-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ps-chip span {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
    background: var(--tile); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 16px; font-weight: 500;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .16s var(--ease-out);
}
.ps-chip:hover span { box-shadow: inset 0 0 0 1px var(--faint); }
.ps-chip input:checked + span { background: var(--btn); color: #ffffff; box-shadow: none; }
.ps-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.ps-chip input:disabled + span { opacity: .4; cursor: not-allowed; }
.ps-chip:active span { transform: scale(.97); }

/* Auswahlkarten (Lieferung, Wunsch) */
.ps-options { margin: 0; padding: 0; border: 0; display: grid; gap: 12px; }
.ps-option {
    position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
    padding: 16px 20px 16px 16px; border-radius: 18px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
    transition: box-shadow .2s ease, background-color .2s ease, transform .16s var(--ease-out);
}
.ps-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ps-option:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.ps-option:active { transform: scale(.99); }
.ps-option:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.ps-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.ps-option-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--tile-2); color: var(--accent); }
.ps-option-ico .pp-ico { width: 22px; height: 22px; }
.ps-option-text { display: grid; gap: 2px; }
.ps-option-text strong { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.ps-option-text small { color: var(--muted); font-size: 15px; line-height: 1.4; }
.ps-option-tick {
    display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line-strong); color: transparent;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.ps-option-tick .pp-ico { width: 14px; height: 14px; }
.ps-option:has(input:checked) .ps-option-tick { background: var(--btn); box-shadow: none; color: #ffffff; }
.ps-options[aria-invalid="true"] .ps-option { box-shadow: inset 0 0 0 1px var(--danger); }

/* Speisekarte hochladen */
html:not(.ps-js) .ps-drop { display: none; }
.ps-drop-zone {
    display: grid; justify-items: center; gap: 8px; padding: 32px 24px; border-radius: 18px; text-align: center; cursor: pointer;
    background: var(--tile); box-shadow: inset 0 0 0 1.5px var(--line-strong);
    transition: box-shadow .2s ease, background-color .2s ease;
}
.ps-drop-zone:hover, .ps-drop.is-over .ps-drop-zone { box-shadow: inset 0 0 0 2px var(--accent); }
.ps-drop input:focus-visible + .ps-drop-zone { outline: 2px solid var(--accent); outline-offset: 3px; }
.ps-drop-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; background: var(--tile-2); color: var(--accent); }
.ps-drop-ico .pp-ico { width: 22px; height: 22px; }
.ps-drop-zone strong { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.ps-drop-zone small { color: var(--faint); font-size: 14px; }
.ps-drop-fine { display: none; }
@media (hover: hover) and (pointer: fine) {
    .ps-drop-fine { display: block; }
    .ps-drop-touch { display: none; }
}
.ps-files { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ps-files:not(:empty) { margin-top: 12px; }
.ps-file {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
    padding: 12px 8px 12px 14px; border-radius: 14px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line);
}
.ps-file > .pp-ico { color: var(--accent); }
.ps-file-main { min-width: 0; display: grid; gap: 6px; }
.ps-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 500; }
.ps-file-state { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.ps-file.is-done .ps-file-state { color: var(--ok); }
.ps-file.is-error .ps-file-state { color: var(--danger); }
.ps-file-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ps-file-bar span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform .3s var(--ease-out); }
.ps-file.is-done .ps-file-bar { display: none; }
.ps-file-remove { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.ps-file-remove:hover { background: var(--tile-2); color: var(--danger); }

/* Zusammenfassung */
.ps-summary { margin: 32px 0 0; padding: 0; box-shadow: 0 -1px 0 var(--line); }
.ps-summary-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 16px 0; box-shadow: 0 1px 0 var(--line); }
.ps-summary dt { grid-column: 1; color: var(--faint); font-size: 13px; font-weight: 500; }
.ps-summary dd { grid-column: 1; margin: 0; font-size: 16px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.ps-summary dd.is-empty { color: var(--faint); }
.ps-edit {
    grid-column: 2; grid-row: 1 / span 2; align-self: center; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px;
    background: none; color: var(--accent); font: 500 15px/1 var(--font); cursor: pointer;
}
.ps-edit:hover { background: var(--tile-2); }
@media (min-width: 640px) {
    .ps-summary-row { grid-template-columns: 9.5rem minmax(0, 1fr) auto; align-items: baseline; }
    .ps-summary dt { grid-column: 1; }
    .ps-summary dd { grid-column: 2; }
    .ps-edit { grid-column: 3; grid-row: 1; }
}
.ps-consent { position: relative; display: flex; align-items: flex-start; gap: 12px; margin-top: 32px; font-size: 16px; line-height: 1.45; cursor: pointer; }
.ps-consent input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.ps-box {
    display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--line-strong);
    color: transparent; transition: background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.ps-box .pp-ico { width: 14px; height: 14px; }
.ps-consent input:checked + .ps-box { background: var(--btn); box-shadow: none; color: #ffffff; }
.ps-consent input:focus-visible + .ps-box { outline: 2px solid var(--accent); outline-offset: 3px; }
.ps-consent[aria-invalid="true"] .ps-box { box-shadow: inset 0 0 0 1.5px var(--danger); }
.ps-consent a, .ps-privacy a { color: var(--accent) !important; text-underline-offset: 3px; }
.ps-privacy { margin: 16px 0 0; color: var(--faint); font-size: 14px; line-height: 1.45; }
.ps-btn-lg { min-height: 56px; padding: 0 28px; font-size: 18px; }
.ps-btn-lg .pp-ico, .ps-nav .pp-btn .pp-ico { width: 18px; height: 18px; }
.ps-submit { margin-top: 32px; }
.ps-submit[aria-busy="true"] { opacity: .7; cursor: progress; }

/* Weiter / Zurück */
.ps-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 40px; }
.ps-js .ps-nav[hidden] { display: none; }
.ps-nav-end { display: flex; align-items: center; gap: 8px 16px; margin-inline-start: auto; }
.ps-back, .ps-skip {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px;
    background: none; color: var(--muted); font: 500 16px/1 var(--font); cursor: pointer; transition: color .2s ease, background-color .2s ease;
}
.ps-back { margin-inline-start: -12px; }
.ps-skip { min-height: 48px; padding: 0 20px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); font-size: 17px; }
.ps-back:hover, .ps-skip:hover { color: var(--text); background: var(--tile-2); }
.ps-back[hidden], .ps-skip[hidden] { display: none; }
.ps-enter { display: none; color: var(--faint); font-size: 13px; }
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
    .ps-enter:not([hidden]) { display: inline; }
}

/* ---------- Vorschau des Eintrags ---------- */
.ps-preview-label { margin: 0 0 12px; color: var(--faint); font-size: 13px; font-weight: 500; }
.ps-card { overflow: hidden; border-radius: 24px; background: var(--tile); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.ps-card-media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--tile-2); }
.ps-card-initial { font-size: 72px; font-weight: 600; letter-spacing: -.04em; color: var(--accent); line-height: 1; }
.ps-card-new {
    position: absolute; inset-inline-start: 12px; top: 12px; padding: 4px 10px; border-radius: 999px;
    background: var(--tile); color: var(--text); font-size: 12px; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.ps-card-body { padding: 20px; }
.ps-card-name { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ps-card-kitchens { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.ps-card-address { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.ps-card-address .pp-ico { width: 16px; height: 16px; margin-top: 1px; color: var(--faint); }
.ps-card-chips { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.ps-card-chips li {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--tile-2);
    font-size: 13px; font-weight: 500; transition: opacity .2s ease;
}
.ps-card-chips li[hidden] { display: none; }
.ps-card-chips li.is-off { opacity: .35; }
.ps-card-chips .pp-ico { width: 14px; height: 14px; color: var(--accent); }
.is-placeholder { color: var(--faint) !important; }

/* ---------- Danke ---------- */
.ps-done-mark { width: 64px; height: 64px; margin-bottom: 24px; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ps-done-mark circle { stroke-dasharray: 183; stroke-dashoffset: 0; }
.ps-done-mark path { stroke-dasharray: 40; stroke-dashoffset: 0; }
.ps-done.is-new .ps-done-mark circle { animation: ps-draw .7s var(--ease-out) both; }
.ps-done.is-new .ps-done-mark path { animation: ps-draw-tick .4s var(--ease-out) .45s both; }
@keyframes ps-draw { from { stroke-dashoffset: 183; } }
@keyframes ps-draw-tick { from { stroke-dashoffset: 40; } }
.ps-done-h { margin: 48px 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.ps-next { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.ps-next li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.ps-next-n {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--tile-2);
    color: var(--accent); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.ps-next li > span:last-child { color: var(--muted); font-size: 16px; line-height: 1.5; }
.ps-next strong { display: block; color: var(--text); font-weight: 600; }
.ps-done-app { margin: 40px 0; padding: 20px; border-radius: 18px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); }
.ps-done-app p { margin: 0 0 12px; font-size: 16px; }

/* ---------- AGB ---------- */
.ps-dialog {
    width: min(720px, calc(100% - 32px)); max-height: min(85dvh, 860px); padding: 0; border: 0; border-radius: 20px;
    background: var(--menu); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
}
.ps-dialog[open] { display: flex; flex-direction: column; }
.ps-dialog::backdrop { background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ps-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 20px 16px 24px; box-shadow: 0 1px 0 var(--line); }
.ps-dialog-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.ps-dialog-head .ps-meta { margin-top: 4px; }
.ps-dialog-body { overflow-y: auto; padding: 8px 24px 32px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.ps-dialog-body h1, .ps-dialog-body h2, .ps-dialog-body h3 { margin: 24px 0 8px; color: var(--text); font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.ps-dialog-body a { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
    .ps-dialog[open] { animation: ps-pop .22s var(--ease-out); }
    @keyframes ps-pop { from { opacity: 0; transform: scale(.97); } }
}

@media (prefers-reduced-motion: reduce) {
    .ps-progress span, .ps-file-bar span { transition: none; }
    .ps-option:active, .ps-chip:active span { transform: none; }
    .ps-done.is-new .ps-done-mark circle, .ps-done.is-new .ps-done-mark path { animation: none; }
}
@media (min-width: 768px) {
    :root { --gutter: 32px; }
}
