@charset "UTF-8";
:root {
  /* Same palette as UniFlows. */
  --bg: #fafaf9; /* warm off-white */
  --card: #ffffff;
  --border: #e2e8f0; /* slate-200 */
  --text: #0f172a; /* slate-900 */
  --muted: #64748b; /* slate-500 */
  --accent: #0f172a; /* primary actions */
  --link: #2563eb;
  --ok: #16a34a;
  --bad: #dc2626;
  --star: #f59e0b; /* amber-500 */
  --star-off: #e2e8f0; /* slate-200 */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Signika Negative', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.loading,
.error,
.muted {
  color: var(--muted);
  padding: 16px;
}

.error {
  color: var(--bad);
}

.muted-inline {
  color: var(--muted);
  font-weight: 400;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ */
/* Star rating                                                         */
/* ------------------------------------------------------------------ */

.stars {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}
.stars__star svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: var(--star-off);
}
.stars__star.is-on svg {
  fill: var(--star);
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  text-decoration: none;
  opacity: 0.9;
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--danger {
  background: transparent;
  color: var(--bad);
  border-color: #fecaca;
}
.btn--danger:hover {
  background: #fef2f2;
}

/* ------------------------------------------------------------------ */
/* Public site                                                         */
/* ------------------------------------------------------------------ */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site__header {
  padding: 22px 40px;
  border-bottom: 1px solid var(--border);
}
.site__main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px;
}
.site__footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.site__footer a {
  color: var(--muted);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 48px 28px;
  align-items: start; /* images vary in height — don't stretch rows */
}

/* No card chrome: the photo at its natural proportions, text underneath. */
.review-card {
  display: flex;
  flex-direction: column;
}
/* Natural proportions, capped at 60vh. Auto width + max-* scales it down
   without cropping or distortion; align-self stops the flex column stretching
   it back to full width. */
.review-card__img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 60vh;
  align-self: flex-start;
  border-radius: 8px;
}
.review-card__body {
  padding: 14px 0 0;
}
.review-card__body h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.review-card__body .stars {
  margin-top: 6px;
}
.review-card__body p {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line; /* keep the admin's paragraphs */
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ */
/* Admin shell                                                         */
/* ------------------------------------------------------------------ */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app__nav {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 22px 40px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
}
.app__brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.app__brand:hover {
  text-decoration: none;
}
.app__badge {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.app__nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.app__nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.app__nav-links a.active {
  color: var(--text);
  font-weight: 600;
}
.app__nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}
.app__main {
  padding: 28px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.admin-row__thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
}
.admin-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-row__review {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-row__date {
  color: var(--muted);
  font-size: 12px;
}
.admin-row__actions {
  display: flex;
  gap: 8px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form header {
  margin-bottom: 0;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form__hint {
  text-transform: none;
  letter-spacing: 0;
}
.form input,
.form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}
.form input[type='file'] {
  padding: 8px;
}
.form textarea {
  resize: vertical;
  line-height: 1.5;
}
.form__preview {
  display: block;
  width: 240px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.form__actions {
  display: flex;
  gap: 10px;
}

/* Overrides the generic .form label / .form input rules above. */
.star-input {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.star-input legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.star-input__stars {
  display: flex;
  align-items: center;
  gap: 2px;
}
.star-input .star-input__star {
  position: relative;
  display: block;
  padding: 2px;
  border-radius: 6px;
  cursor: pointer;
}
.star-input .star-input__star input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.star-input__star svg {
  display: block;
  width: 30px;
  height: 30px;
  fill: var(--star-off);
  transition: fill 0.1s, transform 0.1s;
}
.star-input__star.is-on svg {
  fill: var(--star);
}
.star-input__star:hover svg {
  transform: scale(1.1);
}
.star-input__star:has(input:focus-visible) {
  outline: 2px solid var(--link);
  outline-offset: 1px;
}
.star-input__value {
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------------ */
/* Login                                                               */
/* ------------------------------------------------------------------ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-card h1 {
  margin: 0;
  font-size: 24px;
}
.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-card input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
}
.auth-card button[type='submit'] {
  margin-top: 4px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.auth-card button[type='submit']:disabled {
  opacity: 0.6;
  cursor: default;
}
.auth-error {
  background: #fef2f2;
  color: var(--bad);
  border: 1px solid #fecaca;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .site__header,
  .site__footer {
    padding: 18px 16px;
  }
  .site__main {
    padding: 24px 16px;
  }
  .app__nav {
    padding: 18px 16px;
    gap: 16px;
    flex-wrap: wrap;
  }
  .app__nav-links {
    gap: 18px;
    margin-left: 0;
  }
  .app__main {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .review-grid {
    grid-template-columns: 1fr;
  }
  .admin-row {
    flex-wrap: wrap;
  }
  .admin-row__actions {
    width: 100%;
  }
  .admin-row__actions .btn {
    flex: 1;
  }
  .auth-card {
    padding: 24px 20px;
  }
}

