@font-face {
  font-family: "Awesome Serif VAR";
  src: url("/fonts/AwesomeSerifVAR-Light.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #e8e8e8;
  --panel: #f1f1f1;
  --panel-border: #d8d8d8;
  --input-bg: #ebebeb;
  --text: #323232;
  --muted: #666666;
  --button: #f7f7f7;
  --button-text: #323232;
  --accent: #6ea8fe;
  --danger: #d95151;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Awesome Serif VAR", Arial, Helvetica, serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-y: auto;
}

body.admin-mode {
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  font-weight: 600;
}

.page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 16px;
}

.brand-logo-top {
  width: min(250px, 92vw);
  max-height: 160px;
  object-fit: contain;
  display: block;
  margin: 8px auto 22px;
}

.card {
  position: relative;
  width: min(100%, 700px);
  height: auto;
  max-height: none;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: clamp(20px, 2.8vw, 34px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(0, 0, 0, 0.28) 0.5px, transparent 0.7px),
    radial-gradient(circle at 74% 18%, rgba(0, 0, 0, 0.22) 0.5px, transparent 0.7px),
    radial-gradient(circle at 34% 68%, rgba(0, 0, 0, 0.2) 0.5px, transparent 0.7px),
    radial-gradient(circle at 86% 78%, rgba(0, 0, 0, 0.24) 0.5px, transparent 0.7px);
  background-size: 170px 170px, 220px 220px, 190px 190px, 240px 240px;
  background-repeat: repeat;
  mix-blend-mode: multiply;
}

.card > * {
  position: relative;
  z-index: 1;
}

.brand-row {
  display: block;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.1vw, 2rem);
  line-height: 1.2;
}

h2 {
  margin: 18px 0 8px;
  font-size: 1rem;
}

.subhead {
  margin: 8px 0 24px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
}

.field,
.admin-section {
  margin-bottom: 24px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #c9c9c9;
  background: var(--input-bg);
  color: var(--text);
  padding: 15px 14px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  outline: none;
}

.textarea {
  resize: vertical;
}

.input::placeholder {
  color: #8a8a8a;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.2);
}

.dropzone {
  border: 2px dashed #bbbbbb;
  border-radius: 12px;
  background: #ebebeb;
  padding: clamp(20px, 4vw, 34px) 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: #f8f8f8;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #edf5ff;
}

.icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.hint {
  color: var(--muted);
  font-size: 1rem;
}

.hint strong {
  color: var(--text);
}

.preview {
  margin-top: 14px;
  border: 1px solid #c9c9c9;
  border-radius: 10px;
  min-height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ebebeb;
}

.preview p {
  color: var(--muted);
  margin: 0;
  padding: 12px;
  text-align: center;
}

.preview img,
.preview video {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

.selected-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.selected-list li {
  background: #ebebeb;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submit {
  margin-top: 14px;
  width: 100%;
  border: 1px solid #c4c4c4;
  border-radius: 18px;
  padding: 13px 18px;
  font-family: "Awesome Serif VAR", Arial, Helvetica, serif;
  font-size: 1.02rem;
  font-weight: 800;
  font-variation-settings: "wght" 800;
  color: var(--button-text);
  background: var(--button);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 5px rgba(0, 0, 0, 0.08);
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.08s ease;
}

.submit:hover:not(:disabled) {
  background: #efefef;
}

.submit:active:not(:disabled) {
  transform: translateY(1px);
}

.submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.submit.is-loading .btn-text {
  opacity: 0.8;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #9c9c9c;
  border-top-color: #3f3f3f;
  display: inline-block;
  margin-left: 8px;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status {
  margin-top: 10px;
  min-height: 1.2em;
  color: #2d6a37;
  font-size: 0.92rem;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 8px;
  min-height: 1.2em;
}

.hidden {
  display: none !important;
}

.admin-card {
  width: min(100%, 640px);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 14px 8px 24px;
  overflow: visible;
}

.admin-card::before {
  content: none;
}

.admin-title {
  font-size: 1.95rem;
  margin: 0 0 6px;
}

.admin-subhead {
  margin: 0 0 36px;
  color: #666666;
  font-size: 1rem;
}

.admin-field {
  margin-bottom: 22px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 10px 0 28px;
}

.color-grid label {
  margin-bottom: 0;
  display: grid;
  gap: 10px;
}

.admin-btn {
  max-width: 100%;
  margin-top: 24px;
}

.secondary {
  background: #ececec;
}

.sign-in-btn {
  border-radius: 10px;
  border: 1px solid #1b1b1b;
  background: #1a1a1a;
  color: #f2f2f2;
  box-shadow: none;
}

.sign-in-btn:hover:not(:disabled) {
  background: #111111;
}

.sign-in-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.tiny-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 10px;
}

.back-link {
  color: inherit;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.logo-dropzone {
  margin: 12px 0 22px;
  padding: 24px 14px;
}

.admin-mode h2 {
  margin: 36px 0 18px;
  font-size: 1.15rem;
}

.admin-mode .input {
  border-radius: 16px;
  min-height: 64px;
  padding: 17px 16px;
  font-size: 1.05rem;
}

.admin-mode .textarea {
  min-height: 120px;
  line-height: 1.4;
}

.admin-mode label {
  font-size: 0.96rem;
  color: #3d3d3d;
}

@media (max-width: 680px) {
  .card {
    height: auto;
    max-height: none;
    padding: 16px;
  }

  .color-grid {
    grid-template-columns: 1fr;
  }
}
