/* =========================================================================
   APP-SPEZIFISCHE STYLES (Login, Admin-Dashboard, Einladungs-Flow)
   baut auf base.css + theme-blush.css auf.
   ========================================================================= */

/* ----- Formularelemente ------------------------------------------------ */
.field { display: block; margin-bottom: 16px; }
.field > label { display: block; font-family: var(--font-display); font-weight: 600; margin-bottom: 7px; }
.input, .textarea, select.input {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--border); border-bottom-width: 3px;
  border-radius: 14px; padding: 13px 15px;
  transition: border-color .15s ease;
}
.input:focus, .textarea:focus, select.input:focus { outline: none; border-color: var(--primary); }
.textarea { min-height: 96px; resize: vertical; }
.hint { color: var(--ink-soft); font-size: .85rem; margin-top: 6px; }

/* Info-Icon mit Tooltip (passend zur UI) */
.info {
  position: relative; display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; margin-left: 6px;
  background: var(--surface-2); color: var(--primary);
  border: 1.5px solid var(--border);
  font-family: var(--font-display); font-weight: 600; font-size: .72rem; font-style: normal;
  cursor: help; user-select: none;
}
.info::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 240px;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--border); border-bottom-width: 3px; border-radius: 12px;
  padding: 9px 12px; font-family: var(--font-rounded); font-size: .82rem; font-weight: 600; line-height: 1.35; text-align: left;
  box-shadow: var(--shadow-card);
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; z-index: 70;
}
.info::before {
  content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--border);
  opacity: 0; transition: opacity .15s ease; z-index: 71;
}
.info:hover::after, .info:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.info:hover::before, .info:focus-visible::before { opacity: 1; }

/* ----- Charaktere (Anzeige + Baukasten) ------------------------------- */
.char-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.char-fig { display: inline-block; width: 84px; height: 98px; animation: charBob 3.2s ease-in-out infinite; }
.char-fig.sm { width: 62px; height: 74px; }
.char-strip .char-fig:nth-child(2) { animation-delay: .6s; }
.char-eyes { animation: charBlink 4.6s infinite; }
@keyframes charBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes charBlink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.12); } }
.char-strip { display: flex; justify-content: center; align-items: flex-end; gap: 20px; margin: 2px 0 8px; }

/* Baukasten im Admin */
.char-preview { display: grid; place-items: center; height: 172px; background: var(--surface-2); border: 2px solid var(--border); border-radius: 18px; margin-bottom: 14px; }
.char-preview .char-fig { width: 120px; height: 142px; }
.charedit-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.char-lbl { font-family: var(--font-display); font-weight: 600; font-size: .9rem; margin: 8px 0 4px; display: block; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.sw.is-on { outline: 3px solid var(--primary); outline-offset: 1px; }
.optrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.optbtn { font-family: var(--font-display); font-weight: 600; font-size: .85rem; padding: 7px 12px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; }
.optbtn.is-on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-shadow); }

/* Landing: Foto blendet verzögert über die Silhouette ein */
.avatar__img .avatar-late { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.avatar__img .avatar-late.show { opacity: 1; }

/* Kategorie-Checkliste im Admin */
.checklist { display: grid; gap: 10px; }
.check {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--border); border-bottom-width: 4px;
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.check:hover { border-color: var(--ring); }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.check.is-on { border-color: var(--primary); background: var(--primary-soft); }
.check .emoji { font-size: 1.3rem; }
.check .t { font-family: var(--font-display); font-weight: 600; }
.check .q { color: var(--ink-soft); font-size: .85rem; }

/* ----- Login ----------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; text-align: center; }

/* ----- Badges / Status ------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .78rem; padding: 5px 11px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.badge--pending { background: var(--surface-2); color: var(--ink-soft); }
.badge--answered { background: var(--primary-soft); color: var(--primary-shadow); }

/* ----- Date-Liste im Admin -------------------------------------------- */
.date-item { margin-bottom: 16px; }
.date-item__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.date-item__name { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.linkrow { display: flex; gap: 8px; align-items: stretch; margin-top: 12px; }
.linkrow .input { font-size: .85rem; color: var(--ink-soft); }
.answer-box { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.answer-line { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.answer-line:last-child { border: none; }
.answer-line .k { color: var(--ink-soft); min-width: 120px; font-weight: 700; }
.answer-line .v { font-weight: 800; }
.msg-quote { margin-top: 12px; padding: 14px 16px; border-left: 4px solid var(--primary); background: var(--surface); border-radius: 10px; font-style: italic; }

/* ----- Einladungs-Flow ------------------------------------------------- */
.flow { max-width: 620px; margin-inline: auto; }
.flow-step { display: none; }
.flow-step.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.flow-top { position: sticky; top: 0; z-index: 10; padding: 14px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(6px); }
.flow-top .row { gap: 12px; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--border); border-bottom-width: 4px; background: var(--surface); display: grid; place-items: center; font-size: 1.2rem; flex: none; }

.summary-line { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 2px dashed var(--border); }
.summary-line:last-child { border: none; }
.summary-line .emoji { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.summary-line .t { font-family: var(--font-display); font-weight: 600; }
.summary-line .s { color: var(--ink-soft); font-size: .88rem; }
.summary-line .edit { margin-left: auto; color: var(--primary); font-weight: 800; font-size: .85rem; background: none; border: none; }

.done-emoji { font-size: 4rem; line-height: 1; }
.cal-btns { display: grid; gap: 12px; margin-top: 8px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----- Modal (Einstellungen) ------------------------------------------ */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(60, 30, 40, .45); backdrop-filter: blur(3px); }
.modal__card { position: relative; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(120, 40, 70, .3); animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.photo-pick { display: flex; align-items: center; gap: 16px; }
.photo-pick .avatar__img { width: 84px; height: 84px; }

/* ----- Slider (Range-Input) ------------------------------------------- */
.slider { width: 100%; accent-color: var(--primary); height: 30px; cursor: pointer; }

/* ----- Karussell (Stufen-Auswahl, z. B. Nähe) ------------------------- */
.carousel { position: relative; height: 224px; margin: 8px 0; overflow: hidden; }
.carousel-card {
  position: absolute; left: 50%; top: 14px;
  width: 150px; height: 190px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 2px solid var(--border); border-bottom-width: 5px;
  border-radius: 22px; padding: 16px; text-align: center;
  transition: transform .34s cubic-bezier(.2,.7,.2,1), opacity .3s ease, box-shadow .25s ease, border-color .2s ease;
  will-change: transform; backface-visibility: hidden;
}
.carousel-card.is-front { border-color: var(--primary); box-shadow: var(--shadow-card); }
.carousel-card.is-locked { filter: grayscale(.85) opacity(.9); cursor: not-allowed; background: var(--surface-2); color: var(--ink-soft); }
.carousel-card .cc-emoji { font-size: 2.6rem; line-height: 1; }
.carousel-card .cc-label { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; }
.carousel-card .cc-desc { color: var(--ink-soft); font-size: .82rem; }
.carousel-card .cc-lock { position: absolute; top: 9px; right: 12px; font-size: 1rem; filter: none; }
.rings-ico { height: 1em; width: auto; display: inline-block; vertical-align: middle; }

/* ----- Versteckter Edelstein (Easter-Egg) ----------------------------- */
.gem-corner {
  position: fixed; right: 16px; bottom: 16px; z-index: 45;
  width: 50px; height: 50px; border-radius: 50%; border: none;
  background: radial-gradient(circle at 32% 28%, #ffffff, var(--primary-soft) 70%);
  box-shadow: var(--shadow-card); cursor: pointer;
  font-size: 1.5rem; line-height: 1; display: grid; place-items: center;
  animation: gemPulse 1.9s ease-in-out infinite;
}
.gem-corner:hover { filter: brightness(1.05); }
@keyframes gemPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 18px rgba(190,90,110,.18); }
  50% { transform: scale(1.12) rotate(4deg); box-shadow: 0 10px 26px rgba(190,90,110,.32); }
}

/* ----- Tabs (im Modal) ------------------------------------------------- */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--border); }
.tab { border: none; background: none; font-family: var(--font-display); font-weight: 600; color: var(--ink-soft); padding: 10px 14px; border-radius: 12px 12px 0 0; position: relative; }
.tab.is-active { color: var(--primary); }
.tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 3px; background: var(--primary); border-radius: 3px; }
.tabpane[hidden] { display: none; }

/* ----- History-Verwaltung (Admin) ------------------------------------- */
.hist-pick { flex: none; width: 120px; }
.hist-thumb { width: 120px; height: 90px; border-radius: 12px; border: 2px dashed var(--border); background: var(--surface-2); display: grid; place-items: center; color: var(--ink-soft); font-size: .78rem; text-align: center; overflow: hidden; }
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hist-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 2px solid var(--border); border-bottom-width: 3px; border-radius: 14px; margin-bottom: 10px; }
.hist-item__thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; display: grid; place-items: center; font-size: 1.3rem; }
.hist-item__body { flex: 1; min-width: 0; }
.hist-item__title { font-family: var(--font-display); font-weight: 600; }
.hist-item__meta { color: var(--ink-soft); font-size: .85rem; }

/* ----- Öffentliche Galerie (history.html) ----------------------------- */
.gallery { column-width: 280px; column-gap: 18px; }
.gcard { break-inside: avoid; margin: 0 0 18px; border-radius: 18px; overflow: hidden; background: var(--surface); border: 2px solid var(--border); border-bottom-width: 4px; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease; }
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.gcard img { width: 100%; display: block; }
.gcard__ph { aspect-ratio: 4/3; display: grid; place-items: center; font-size: 2.4rem; background: linear-gradient(160deg, var(--primary-soft), var(--surface-2)); }
.gcard__cap { padding: 12px 16px; }
.gcard__title { font-family: var(--font-display); font-weight: 600; }
.gcard__meta { color: var(--ink-soft); font-size: .85rem; }

/* ----- Lightbox -------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(50, 25, 35, .82); backdrop-filter: blur(4px); display: none; place-items: center; padding: 24px; }
.lightbox.show { display: grid; }
.lightbox__inner { text-align: center; max-width: 94vw; }
.lightbox img { max-width: 94vw; max-height: 78vh; border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
.lightbox__cap { color: #fff; margin-top: 14px; font-weight: 700; font-size: 1.05rem; }
.lightbox__cap small { display: block; opacity: .8; font-weight: 600; }
.lightbox__close { position: absolute; top: 16px; right: 20px; font-size: 1.7rem; color: #fff; background: none; border: none; cursor: pointer; }
