:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef6ef;
  color: #0f3d2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #eef6ef;
}

.page-shell {
  width: min(1100px, 100%);
  display: grid;
  gap: 1.5rem;
}

.upload-card,
.preview-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 18px 35px rgba(16, 42, 67, 0.08);
}

.upload-card header,
.preview-card header {
  margin-bottom: 1.25rem;
}

h1,
h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f3d2e;
}

.input-row {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #315c3a;
}

.file-name-input {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafb;
  border-radius: 999px;
  padding: 0.9rem 1rem;
  border: 1px solid #cbd5e1;
}

.file-name-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  outline: none;
}

.file-name-input span {
  color: #475569;
  font-weight: 600;
}

input[type="file"] {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px dashed #b7d2c3;
  border-radius: 1rem;
  background: #f3faf5;
  color: #0f3d2e;
}

input[type="file"]::file-selector-button {
  border: none;
  background: transparent;
  color: #1f6b45;
  font-weight: 700;
  cursor: pointer;
}

small {
  color: #64748b;
  line-height: 1.5;
}

.primary-button,
.secondary-button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.primary-button {
  background: #1f6b45;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(31, 107, 69, 0.16);
}
.primary-button:hover {
  transform: translateY(-1px);
  background: #155836;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  background: #f5faf3;
  color: #315c3a;
  border: 1px solid #c7d8c6;
}

.preview-box {
  min-height: 320px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: #f4fbf3;
  border: 1px solid #c7ddc9;
  overflow: hidden;
  position: relative;
}

.preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

.preview-placeholder {
  color: #64748b;
  font-size: 1rem;
}

.status-message {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  font-size: 0.95rem;
  min-height: 2.2rem;
  line-height: 1.4;
}

.status-message--success {
  background: #dff4e7;
  color: #155a38;
  border: 1px solid rgba(31, 107, 69, 0.25);
}

.status-message--error {
  background: #fee3e3;
  color: #8f1d21;
  border: 1px solid rgba(222, 68, 68, 0.25);
}

.status-message--info {
  background: transparent;
}

.gallery-grid {
  display: grid;
  gap: 1rem;
}

.gallery-item {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  background: #f8fafb;
  border-radius: 1.25rem;
  border: 1px solid #e2e8f0;
}

.gallery-item img {
  width: 100%;
  border-radius: 1rem;
  max-height: 220px;
  object-fit: cover;
}

.gallery-item span {
  font-size: 0.95rem;
  color: #0f1720;
  font-weight: 600;
}

.gallery-footer {
  margin-top: 1rem;
}

@media (min-width: 900px) {
  .page-shell {
    grid-template-columns: minmax(300px, 1fr) minmax(360px, 1fr);
    align-items: start;
  }

  .gallery-card {
    grid-column: span 2;
  }
}

.server-warning {
  background: #fde2e1;
  color: #842029;
  border: 1px solid #f5c2c7;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .upload-card,
  .preview-card,
  .gallery-card {
    padding: 1.25rem;
  }
}
