/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #111111;
  --gray-1:  #f5f5f5;
  --gray-2:  #e5e5e5;
  --gray-3:  #aaaaaa;
  --gray-4:  #666666;
  --white:   #ffffff;
  --radius:  6px;
  --font:    'Arial', sans-serif;
  --max-w:   860px;
  --shadow:  0 1px 4px rgba(0,0,0,.10);
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--black);
  background: var(--gray-1);
  min-height: 100vh;
  line-height: 1.5;
}

/* ─── Layout ────────────────────────────────────────────────────────── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-2);
  padding: 20px 24px;
}

header .brand {
  max-width: var(--max-w);
  margin: 0 auto;
}

header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

header p {
  font-size: 13px;
  color: var(--gray-4);
  margin-top: 2px;
}

main {
  max-width: var(--max-w);
  margin: 32px auto;
  padding: 0 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

footer.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--gray-3);
  padding: 24px 16px;
}

.legal-disclaimer {
  max-width: 680px;
  margin: 10px auto 0;
  font-size: 11px;
  color: var(--gray-3);
  line-height: 1.6;
}

/* ─── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 24px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-4);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-2);
}

/* ─── Form fields ────────────────────────────────────────────────────── */
.field-group {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 12px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--black);
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--black);
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
  border-color: var(--black);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

/* ─── Upload area ────────────────────────────────────────────────────── */
#drop-zone {
  border: 2px dashed var(--gray-2);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--black);
  background: var(--gray-1);
}

#drop-zone svg {
  margin-bottom: 10px;
  opacity: 0.4;
}

#drop-zone p {
  font-size: 15px;
  color: var(--gray-4);
}

#drop-zone span {
  font-size: 12px;
  color: var(--gray-3);
  display: block;
  margin-top: 4px;
}

#file-input { display: none; }

/* ─── Photo grid ─────────────────────────────────────────────────────── */
#photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-card {
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--gray-1);
}

.photo-card-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.photo-card-body input[type="text"] {
  font-size: 12px;
  padding: 6px 8px;
}

.photo-card-actions {
  display: flex;
  gap: 4px;
  justify-content: space-between;
  align-items: center;
}

.btn-icon {
  background: none;
  border: 1px solid var(--gray-2);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-4);
  line-height: 1;
  transition: border-color 0.12s, color 0.12s;
}

.btn-icon:hover { border-color: var(--black); color: var(--black); }

.btn-remove {
  color: #cc0000;
  border-color: #eeccc;
}

.btn-remove:hover { border-color: #cc0000; color: #cc0000; }

.room-input { display: none; }
.room-input.visible { display: block; }

/* ─── Options toggles ────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-2);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label {
  flex: 1;
  font-size: 14px;
}

.toggle-label strong {
  display: block;
  font-weight: 600;
}

.toggle-label small {
  font-size: 12px;
  color: var(--gray-4);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input { display: none; }

.slider {
  position: absolute;
  inset: 0;
  background: var(--gray-2);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--white);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.switch input:checked + .slider { background: var(--black); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.toggle-content {
  display: none;
  margin-top: 10px;
  padding: 14px;
  background: var(--gray-1);
  border-radius: var(--radius);
  border: 1px solid var(--gray-2);
}

.toggle-content.visible { display: block; }

/* ─── Generate section ───────────────────────────────────────────────── */
#generate-section {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.80; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--black);
  border-radius: var(--radius);
  padding: 11px 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover { background: var(--gray-1); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── Status messages ────────────────────────────────────────────────── */
#status {
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  display: none;
}

#status.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  color: var(--gray-4);
}

#status.error {
  display: block;
  background: #fff5f5;
  border: 1px solid #f5c6c6;
  color: #aa0000;
}

#status.success {
  display: block;
  background: #f5fff5;
  border: 1px solid #c6f5c6;
  color: #006600;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-2);
  border-top-color: var(--gray-4);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ─── Detail fields grid (5 optional property fields) ───────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .field-group { grid-template-columns: 1fr; }
  #generate-section { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-secondary { justify-content: center; }
}
