*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #F4611A;
  --orange-light: #FF8440;
  --bg: #F5F4F0;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-hint: #9e9e9e;
  --border: rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, .logo { font-family: 'Syne', sans-serif; }

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 0.5rem;
}
.site-header.centered {
  flex-direction: column;
  text-align: center;
  padding: 1rem 0 0;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  background: var(--orange);
  color: white;
  border-radius: 99px;
  letter-spacing: 0.3px;
}
.album-heading {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-top: 6px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.create-card h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }

/* Inputs */
.input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
input[type="text"] {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus { border-color: var(--orange); }

/* Buttons */
.btn-primary, .btn-secondary {
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { background: var(--bg); border: 1px solid var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: #ebebeb; }

/* Section title */
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

/* Album row */
.album-row {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease;
}
.album-info { flex: 1; min-width: 0; }
.album-name {
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.album-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-sm {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  transition: background 0.12s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-sm:hover { background: #ebebeb; }
.btn-sm.qr { background: var(--orange); color: white; border-color: var(--orange); }
.btn-sm.qr:hover { opacity: 0.88; }
.btn-sm.danger { color: #c0392b; border-color: rgba(192,57,43,0.3); }
.btn-sm.danger:hover { background: #fff0ee; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-hint);
  font-size: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
}

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  animation: popIn 0.2s ease;
}
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; }
.modal-title { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; }
.close-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 0 4px; line-height: 1; }
.qr-wrapper { display: flex; justify-content: center; margin-bottom: 1rem; }
.qr-wrapper > div { padding: 14px; background: white; border-radius: 12px; border: 1px solid var(--border); display: inline-block; }
.link-box {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn-secondary, .modal-actions .btn-primary { flex: 1; height: 40px; font-size: 14px; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: var(--bg-card);
}
.dropzone:hover, .dropzone.dragover { background: #fff3ee; border-color: var(--orange); }
.dropzone-icon { font-size: 36px; margin-bottom: 10px; }
.dropzone-title { font-size: 16px; font-weight: 500; }

/* Progress */
.progress-wrap { background: var(--bg-card); border-radius: var(--radius); padding: 1rem 1.25rem; border: 0.5px solid var(--border); }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.progress-track { height: 5px; background: #ebebeb; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--orange); border-radius: 99px; transition: width 0.2s; width: 0%; }

/* Success banner */
.success-banner {
  background: #edfaf3;
  color: #1a7a4a;
  border: 1px solid rgba(26,122,74,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #ddd;
  animation: fadeIn 0.2s ease;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item .del-btn {
  position: absolute;
  top: 5px; right: 5px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.gallery-item:hover .del-btn { opacity: 1; }
.count-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  padding: 2px 9px;
  font-weight: 400;
  color: var(--text-muted);
}

/* Misc */
.muted { color: var(--text-muted); font-size: 14px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
  .album-actions { flex-wrap: wrap; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
