:root {
  --bg-top: #f7efe5;
  --bg-bottom: #fdf8f2;
  --card: #fffefc;
  --text: #2f2925;
  --muted: #6f645c;
  --primary: #b65b3d;
  --primary-strong: #8e4028;
  --secondary: #2f6e67;
  --border: #ecdccf;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Nunito", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, #f7d6bd 0, transparent 42%),
    radial-gradient(circle at bottom left, #e8f0da 0, transparent 40%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

a {
  color: inherit;
  text-decoration: none;
}

.hero-card,
.panel {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(93, 66, 42, 0.12);
}

.hero-card h1,
.panel h1 {
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1.2;
  margin: 0.75rem 0;
  text-align: center;
}

.hero-subtitle,
.panel-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.hero-logo {
  width: min(70vw, 260px);
  display: block;
  margin: 0 auto 0.5rem;
}

.hero-actions,
.bottom-actions {
  display: grid;
  gap: 0.75rem;
}

.big-button,
.link-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.big-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 14px rgba(182, 91, 61, 0.35);
}

.big-button:hover,
.big-button:focus-visible {
  background: var(--primary-strong);
  outline: none;
}

.big-button.secondary {
  background: var(--secondary);
  box-shadow: 0 6px 14px rgba(47, 110, 103, 0.35);
}

.big-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.link-button {
  color: var(--secondary);
  border: 2px solid rgba(47, 110, 103, 0.25);
  background: #fff;
}

.button-block {
  width: 100%;
}

.file-input {
  width: 100%;
  margin: 1rem 0;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  background: #fff;
}

.form-input:focus {
  outline: 3px solid rgba(182, 91, 61, 0.2);
  border-color: var(--primary);
}

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

.upload-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 92px;
  border-radius: 14px;
  border: 2px dashed var(--primary);
  background: #fff9f4;
  color: var(--primary-strong);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 1rem;
  cursor: pointer;
}

.upload-tile:hover,
.upload-tile:focus-visible {
  background: #fff0e4;
}

.status-message {
  margin: 1rem 0;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff6ec;
  color: #5a4337;
  text-align: center;
  font-weight: 600;
}

.upload-progress {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  accent-color: var(--primary);
}

.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26, 22, 19, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.upload-overlay-card {
  width: min(100%, 540px);
  background: #fffefc;
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 1.1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.upload-overlay-card h2 {
  margin: 0.4rem 0 0.6rem;
}

.upload-overlay-note {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.upload-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid #f1dfd3;
  border-top-color: var(--primary);
  animation: upload-spin 0.9s linear infinite;
}

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

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}

.gallery-item {
  margin: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.gallery-open-button {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-open-button:focus-visible {
  outline: 3px solid rgba(182, 91, 61, 0.35);
  outline-offset: -3px;
}

.gallery-item figcaption {
  padding: 0.45rem;
  font-size: 0.8rem;
  text-align: center;
  color: var(--muted);
}

.panel h2 {
  margin: 1.2rem 0 0.4rem;
  color: var(--primary-strong);
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(26, 22, 19, 0.82);
}

.lightbox-dialog {
  width: min(100%, 980px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: rgba(255, 254, 252, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.lightbox-close {
  align-self: flex-end;
  border: none;
  border-radius: 999px;
  background: #f1dfd3;
  color: var(--primary-strong);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.lightbox-image {
  width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  border-radius: 12px;
  background: #f7efe5;
}

.lightbox-caption {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.admin-list {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0;
}

.admin-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 0.8rem;
}

.admin-thumb {
  display: block;
  width: 100%;
  height: clamp(180px, 28vw, 260px);
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f7efe5;
}

.admin-meta {
  margin: 0.7rem 0;
  color: #433a35;
  font-size: 0.92rem;
}

.admin-meta p {
  margin: 0.25rem 0;
}

.admin-actions {
  display: grid;
  gap: 0.65rem;
}

.danger-button {
  color: #8d2f2f;
  border-color: rgba(141, 47, 47, 0.22);
  background: #fff6f5;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: #ffeceb;
  outline: none;
}

@media (min-width: 768px) {
  .content-shell {
    padding: 2rem 1.25rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
