:root {
  --ink: #14241f;
  --ink-soft: #4a5f57;
  --paper: #f4f0e7;
  --surface: rgba(255, 252, 246, 0.88);
  --accent: #0d6557;
  --accent-hover: #095045;
  --accent-soft: rgba(13, 101, 87, 0.12);
  --line: rgba(20, 36, 31, 0.12);
  --danger: #a33b3b;
  --ok: #0d6557;
  --shadow: 0 24px 60px rgba(20, 36, 31, 0.1);
  --radius: 22px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", "Noto Sans Ethiopic", sans-serif;
  --font-amharic: "Noto Sans Ethiopic", "Outfit", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 8% -8%, rgba(13, 101, 87, 0.16), transparent 58%),
    radial-gradient(ellipse 70% 45% at 100% 5%, rgba(176, 138, 60, 0.14), transparent 52%),
    radial-gradient(circle at 50% 120%, rgba(13, 101, 87, 0.08), transparent 45%),
    linear-gradient(165deg, #f8f4eb 0%, #f1ebe0 48%, #e8e0d1 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.page {
  width: min(580px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 3.75rem) 0 calc(2.5rem + env(safe-area-inset-bottom));
  animation: rise 0.75s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes check-in {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.brand {
  margin-bottom: 2rem;
  text-align: center;
}

.brand__mark {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 9vw, 3.7rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--ink);
}

.brand__title {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand__lead {
  margin: 0 auto;
  max-width: 22em;
  color: var(--ink-soft);
  font-family: var(--font-amharic);
  font-size: clamp(1.05rem, 3.4vw, 1.2rem);
  font-weight: 500;
  line-height: 1.7;
}

.form,
.success {
  display: grid;
  gap: 1.35rem;
  padding: clamp(1.2rem, 3.5vw, 1.7rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: rise 0.85s var(--ease) 0.08s both;
}

.field {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  border: 0;
  padding: 0;
  min-inline-size: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.field__label,
.rating legend {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
}

.req {
  color: var(--accent);
}

.field__hint {
  justify-self: end;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: #8a978f;
}

input[type="text"]:hover,
textarea:hover {
  border-color: rgba(13, 101, 87, 0.28);
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

textarea {
  resize: vertical;
  min-height: 128px;
  line-height: 1.55;
}

.rating__options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.rating__choice {
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rating__choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.rating__chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 5rem;
  padding: 0.65rem 0.25rem;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s var(--ease),
    box-shadow 0.2s ease;
}

.rating__score {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  transition: color 0.2s ease;
}

.rating__text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.2;
  transition: color 0.2s ease;
}

.rating__choice:hover .rating__chip {
  border-color: rgba(13, 101, 87, 0.4);
  transform: translateY(-2px);
}

.rating__choice input:checked + .rating__chip {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(13, 101, 87, 0.28);
  transform: translateY(-2px);
}

.rating__choice input:checked + .rating__chip .rating__score,
.rating__choice input:checked + .rating__chip .rating__text {
  color: #f4f0e7;
}

.rating__choice input:focus-visible + .rating__chip {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 1.05rem 1.5rem;
  background: var(--accent);
  color: #f7f3ea;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 28px rgba(13, 101, 87, 0.22);
}

.btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.7;
  cursor: wait;
  box-shadow: none;
}

.form__message {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 500;
  animation: rise 0.35s var(--ease) both;
}

.form__message.is-ok {
  background: var(--accent-soft);
  color: var(--ok);
}

.form__message.is-error {
  background: rgba(163, 59, 59, 0.1);
  color: var(--danger);
}

.success {
  place-items: center;
  text-align: center;
  padding-block: 2.5rem;
  animation: pop 0.45s var(--ease) both;
}

.success__icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: #f7f3ea;
  font-size: 1.6rem;
  font-weight: 700;
  animation: check-in 0.55s var(--ease) both;
}

.success__title {
  margin: 0;
  font-family: var(--font-amharic);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
}

.success__text {
  margin: 0 0 0.5rem;
  max-width: 28ch;
  color: var(--ink-soft);
}

.footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

/* See-data page */
.data-page .page {
  width: min(720px, calc(100% - 2rem));
}

.data-page .brand__lead {
  max-width: 34ch;
  font-family: var(--font-body);
}

.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.data-count {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 500;
}

.data-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-secondary {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1.05rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: #fff;
}

.btn-secondary:active {
  transform: scale(0.98);
}

.entries {
  display: grid;
  gap: 0.85rem;
}

.entry {
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(20, 36, 31, 0.04);
  animation: rise 0.45s var(--ease) both;
}

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-bottom: 0.55rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.entry__name {
  font-weight: 600;
  color: var(--ink);
}

.entry__rating {
  font-weight: 600;
  color: var(--accent);
}

.entry__opinion {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.entry__contact {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.empty,
.error-state {
  padding: 2.25rem 1.25rem;
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .rating__options {
    gap: 0.35rem;
  }

  .rating__chip {
    min-height: 4.6rem;
    padding: 0.5rem 0.15rem;
    border-radius: 14px;
  }

  .rating__score {
    font-size: 1.35rem;
  }

  .rating__text {
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
