/* Base styles shared in spirit with web/public/style.css (the account page);
   the review page is its own Hosting site, so it carries its own copy. */

:root {
  --red: #d62828;
  --red-dark: #a81d1d;
  --ink: #1f1a1a;
  --muted: #6b6060;
  --line: #e6dcdc;
  --bg: #fbf5f3;
  --card: #ffffff;
  --error: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3ecec;
    --muted: #b5a6a6;
    --line: #3d3232;
    --bg: #1c1515;
    --card: #271e1e;
    --error: #ff8a80;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.card {
  width: 100%;
  max-width: 24rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.brand {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--red);
  text-decoration: none;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1rem;
  margin: 0 0 0.6rem;
}

p {
  margin: 0 0 1rem;
}

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

.small {
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

.tabs button {
  flex: 1;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 0;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  color: var(--red);
  border-bottom-color: var(--red);
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}

input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
}

input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: transparent;
}

button.primary,
button.secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem;
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 0.25rem;
}

button.primary {
  background: var(--red);
  color: #fff;
  border: 0;
}

button.primary:hover {
  background: var(--red-dark);
}

button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.secondary + button.secondary {
  margin-top: 0.6rem;
}

button.apple {
  margin-top: 0.6rem;
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}

button.link {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  padding: 0.6rem 0 0;
  font: inherit;
  color: var(--red);
  cursor: pointer;
}

button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.g {
  font-weight: 800;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1rem 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.message {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--error);
}

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

/* ---- Review page ---------------------------------------------------------- */

body.wide {
  align-items: start;
  padding-top: 2rem;
}

.card.review {
  max-width: 64rem;
}

.review-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.review-head .brand {
  margin: 0;
}

.review-head h1 {
  margin: 0;
  flex: 1;
}

.who {
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.who .link {
  width: auto;
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
}

table.submissions {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.submissions th,
table.submissions td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.submissions th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

table.submissions img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  display: block;
}

table.submissions tr.row {
  cursor: pointer;
}

table.submissions tr.row:hover {
  background: var(--bg);
}

.status {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid var(--line);
}

.status.pending {
  color: var(--red);
  border-color: var(--red);
}

.status.approved {
  color: #2e7d32;
  border-color: #2e7d32;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.small-btn {
  width: auto;
  padding: 0.45rem 0.9rem;
  margin: 0;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 40rem;
  width: calc(100% - 2rem);
  background: var(--card);
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.detail h2 {
  margin: 0 0 0.25rem;
}

.detail img {
  width: 100%;
  max-height: 24rem;
  object-fit: contain;
  border-radius: 12px;
  background: var(--bg);
  margin: 0.75rem 0;
}

.detail p#d-description {
  white-space: pre-wrap;
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.actions button {
  width: auto;
  flex: 1;
  margin: 0;
}

button.danger {
  color: var(--error);
  border-color: var(--error);
}

/* The flex rules above would otherwise beat the hidden attribute. */
[hidden] {
  display: none !important;
}

#filters {
  flex-wrap: wrap;
}

#filters button {
  flex: 1 1 auto;
  min-width: 5.5rem;
}

.card.review {
  max-width: min(64rem, 100%);
  min-width: 0;
}

.queues {
  margin: 0 0 0.75rem;
}

.status.queued,
.status.posting {
  color: #b26a00;
}

#d-queue-actions {
  margin-top: 0.5rem;
}
