@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f2f5fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-dark: #0b5e58;
  --danger: #dc2626;
  --border: #e2e8f0;
  --ring: rgba(15, 118, 110, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Public Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 500px at 50% -220px, #dff5ef 0%, var(--bg) 60%);
  color: var(--text);
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.hero {
  background: linear-gradient(135deg, #0b2f57 0%, #153f73 45%, #1f4f8c 100%);
  border-radius: 20px;
  padding: 18px 18px 16px;
  color: #fff;
  box-shadow: 0 16px 34px rgba(2, 24, 54, 0.28);
  margin-bottom: 18px;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}

.hero-logo {
  width: clamp(30px, 7.5vw, 42px);
  height: clamp(30px, 7.5vw, 42px);
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: #fff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  font-weight: 800;
  white-space: nowrap;
  max-width: 100%;
}

.hero h1 {
  color: #fff;
  margin-bottom: 6px;
}

.hero .muted {
  color: rgba(241, 245, 255, 0.9);
  margin-bottom: 10px;
}

.flag-strip {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #008751 0 33%, #fcd116 33% 66%, #e8112d 66% 100%);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 1.9vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-title {
  margin: 8px 0 4px;
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 6px;
}

.kpi {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 130px;
}

.kpi-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.kpi strong {
  font-size: 1.35rem;
  font-weight: 800;
}

.ghost-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-btn:hover { border-color: #cbd5e1; }

.muted {
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  margin-bottom: 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.mt8 { margin-top: 8px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

.link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.link-item strong {
  font-size: 1rem;
  font-weight: 700;
}

.link-item a {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  margin-right: 8px;
}

.link-item button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 6px;
}

.form label {
  display: block;
  font-weight: 600;
  margin: 11px 0 7px;
  color: #0b223a;
}

.residence-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 14px 0 10px;
  background: #fcfeff;
}

.residence-group legend {
  padding: 0 8px;
  font-weight: 700;
  color: #0b223a;
}

.inline-option {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 8px 0 !important;
  font-weight: 500 !important;
}

.inline-option input {
  width: auto;
  margin: 0;
}

.form input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

.form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

button#submitBtn {
  width: 100%;
  margin-top: 16px;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
}

button#submitBtn:hover { background: var(--primary-dark); }
button#submitBtn:disabled { opacity: 0.65; cursor: not-allowed; }

.status {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #eef2ff;
  color: #1f2937;
  border: 1px solid #dbe4ff;
}

.status.error {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}

.status.success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #bbf7d0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 20;
}

.modal-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
  position: relative;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.qr-image {
  width: 100%;
  max-width: 320px;
  display: block;
  margin: 10px auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

code {
  background: #f1f5f9;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 0.86rem;
}

.hidden { display: none; }

@media (max-width: 560px) {
  .hero {
    border-radius: 16px;
    padding: 14px 14px 12px;
  }

  .hero-top {
    gap: 8px;
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 4px 8px;
    letter-spacing: 0.05em;
  }
}
