:root {
  color-scheme: light;
  --ink: #1f2a37;
  --navy: #33485e;      /* CTA / brand dark */
  --navy-hover: #2a3c50;
  --muted: #8a97a5;
  --field-bg: #e9f0fb;  /* light-blue phone field */
  --field-border: #d5e2f4;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --tint: #f6f8fc;       /* grouped-section background */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #d52b1e;
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.15);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 460px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo {
  width: clamp(120px, 34vw, 210px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 10px 30px rgba(31, 42, 55, 0.12);
}

.brand {
  font-size: clamp(1.6rem, 6vw, 2rem);
  font-weight: 700;
  margin: 1rem 0 0;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.4;
  margin: 1.5rem 0 1.75rem;
}

section { width: 100%; }
form { width: 100%; }

/* ---------- Phone field ---------- */
.phone-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 999px;
  padding: 0.35rem 1.1rem 0.35rem 0.6rem;
}

.country {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  padding: 0.4rem 0.3rem;
  font: inherit;
  color: var(--ink);
  cursor: default;
}
.country .caret { color: var(--muted); font-size: 0.8rem; }
.country .dial { font-weight: 600; }

.flag {
  width: 34px;
  height: 34px;
  background: var(--danger);
  border-radius: 8px;
  position: relative;
  flex: 0 0 auto;
}
.flag::before,
.flag::after {
  content: "";
  position: absolute;
  background: #fff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.flag::before { width: 42%; height: 13%; }
.flag::after { width: 13%; height: 42%; }

.phone-field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 1.15rem;
  color: var(--ink);
  padding: 0.5rem 0;
}
.phone-field input::placeholder { color: var(--muted); }

.counter {
  text-align: right;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.4rem 0.4rem 0;
}

.otp-input {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
  outline: none;
}

/* ---------- Buttons ---------- */
.cta {
  width: 100%;
  margin-top: 2.5rem;
  padding: 1.05rem;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cta:hover { background: var(--navy-hover); }
.cta:disabled { opacity: 0.55; cursor: not-allowed; }

.link {
  display: inline-block;
  margin-top: 1rem;
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}
.link:hover { text-decoration: underline; }

.status {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.2em;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  color: var(--ink);
  font-size: 1rem;
}
footer a { color: var(--ink); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- Profile ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  margin: 0.5rem 0 1.5rem;
}
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  flex: 0 0 auto;
}
.profile-id { display: flex; flex-direction: column; }
.profile-id strong { font-size: 1.05rem; }

.card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.field {
  display: block;
  border: 0;
  padding: 0;
  margin: 0 0 1.15rem;
}
.field:last-child { margin-bottom: 0; }

/* Grouped multi-control sections: light tinted block, no hard inner border. */
fieldset.field {
  border: 0;
  background: var(--tint);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
fieldset.field.card { background: #fff; border: 1px solid var(--line); }

.field > span,
.field legend { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.field legend { display: block; width: 100%; padding: 0; margin-bottom: 0.6rem; }
.field > span { display: block; margin-bottom: 0.4rem; }
.field small { display: block; margin-top: 0.4rem; line-height: 1.35; }
.req { color: var(--danger); }

input, select, textarea { font: inherit; color: var(--ink); }

/* Unified control look across every text-like field (not checkboxes/radios). */
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea,
.shift-row input,
.pay-field input,
.fn-other-text {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.field textarea:focus,
.shift-row input:focus,
.pay-field input:focus,
.fn-other-text:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}
textarea { min-height: 88px; resize: vertical; }
.check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}
.check input { width: auto; flex: 0 0 auto; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; }

/* "Andere" free-text function */
.fn-other-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.fn-other-row .check { flex: 0 0 auto; margin: 0; }
.fn-other-text { width: auto; flex: 1 1 auto; min-width: 0; }
.fn-other-text:disabled { background: #f3f4f6; color: #9ca3af; }

.area-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}
.add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.add:hover { background: var(--accent-hover); }

.chips {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
/* Selected cantons: circular, tap-to-remove — sized as a mobile touch target. */
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s ease;
}
.chip:hover { background: #dfe4fb; }
.chip:active { background: #c7cffb; }
.chip-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  color: #6b7280;
  border: 1px solid #d1d5db;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.missions {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.missions li {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.missions strong { font-weight: 600; }

.muted { color: var(--muted); }

@media (max-width: 480px) {
  .checks { grid-template-columns: 1fr; }
}

/* ---------- Organizer / staffing search ---------- */
.container-wide { max-width: 560px; }
.section-title { text-align: left; font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 1.25rem; width: 100%; }

/* Shifts — date spans the top row, start–end aligned below */
.shift-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.shift-row .s-date { grid-column: 1 / -1; }
.shift-row .dash { text-align: center; color: var(--muted); }
.chip-x { background: transparent; border: 0; color: var(--muted); font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0 0.15rem; }
.chip-x:hover { color: var(--ink); }

/* Pay */
.pay-field { display: flex; align-items: center; gap: 0.5rem; }
.pay-field input { width: auto; flex: 1 1 auto; }
.pay-unit { color: var(--muted); white-space: nowrap; }

/* Offers list (jobseeker) */
.offers { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.offer-card { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.75rem; display: grid; gap: 0.25rem; }
.offer-row { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.95rem; }
.offer-ico { flex: 0 0 1.3em; text-align: center; }
.offer-shifts { display: grid; gap: 0.2rem; }
.offer-shifts strong { font-weight: 700; }
/* Interesse uses the standard .cta look; only the top margin is card-scoped. */
.interest-btn { margin-top: 0.75rem; }

.small { font-size: 0.85rem; }

/* Delete (destructive) — white with red accent */
.del-btn {
  margin-top: 0.75rem;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--danger);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}
.del-btn:hover { background: #fef2f2; border-color: #fecaca; }
.del-btn:disabled { opacity: 0.6; cursor: default; }

/* Interested people (organizer view) */
.interested { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--line); display: grid; gap: 0.5rem; }
.interested-head { font-weight: 600; font-size: 0.9rem; }
.person { display: flex; align-items: center; gap: 0.6rem; }
.mini-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--line); flex: 0 0 auto; }
.person-info { display: flex; flex-direction: column; min-width: 0; }
.person-info strong { font-size: 0.95rem; }
/* Poster of a Gesuch, shown at the top of the offer card */
.poster { padding-bottom: 0.55rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--line); }

/* Tabs (jobseeker: Gesuche | Mein Profil) */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--navy); color: #fff; }

/* Matching-price banner (organizer, under the section title) */
.price-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.price-label { color: var(--ink); font-weight: 600; }
.price-amounts { display: inline-flex; align-items: baseline; gap: 0.5rem; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 0.95rem; }
.price-new { color: var(--navy); font-weight: 700; font-size: 1.3rem; }

/* Vorteile (organizer, above the price banner) */
.benefits { margin: 0 0 1rem; text-align: left; }
.benefits-lead { margin: 0 0 0.6rem; color: var(--ink); font-weight: 600; }
.benefits-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; justify-items: start; }
.benefits-list li { display: inline-flex; align-items: baseline; gap: 0.5rem; color: var(--ink); }
.benefits-list li::before { content: "✓"; color: var(--navy); font-weight: 700; }

/* Desktop: two-column Gesuche/offers lists (left + right), wider container. */
@media (min-width: 820px) {
  .container { max-width: 820px; }
  .container-wide { max-width: 960px; }
  /* Jobseeker: offers list flows into two columns. */
  .offers { grid-template-columns: 1fr 1fr; align-items: start; }
  /* Benefits in two columns on wider screens. */
  .benefits-list { grid-template-columns: 1fr 1fr; gap: 0.4rem 1.25rem; }
  /* Organizer: creation form and "Meine Gesuche" side by side. */
  .organizer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
  .organizer-cols .card { margin-bottom: 0; }
  /* my-offers sits in a narrow column → single column of cards. */
  .organizer-cols .offers { grid-template-columns: 1fr; }
}
