/* ============================================
   MEMORIFOLIO — Elegant Minimal Stylesheet
   Colors: Warm off-white, near-black, muted gold
   Fonts: Cormorant Garamond + Inter
============================================ */

/* --- CSS Variables (Design Tokens) --- */
:root {
  --bg: #FAFAF8;
  --white: #FFFFFF;
  --dark: #1A1A1A;
  --grey: #6B6B6B;
  --light-grey: #E8E8E4;
  --border: #DEDEDA;
  --gold: #C9A96E;
  --gold-light: #F0E6D0;
  --gold-dark: #A8843E;
  --dark-bg: #1A1A1A;
  --error: #C0392B;
  --success: #2D7D56;

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);

  --transition: all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--dark);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

em { font-style: italic; color: var(--gold); }

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-center { text-align: center; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--dark);
  color: var(--white);
}
.btn-primary:hover { background: #333; transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover { background: var(--gold-dark); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-ghost {
  background: transparent;
  color: var(--dark);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--dark); }

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline-gold:hover { background: var(--gold); color: var(--white); }

.btn-white {
  background: var(--white);
  color: var(--dark);
}
.btn-white:hover { background: var(--gold-light); }

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1.5px solid var(--error);
}
.btn-danger:hover { background: var(--error); color: var(--white); }

.btn-large { padding: 16px 32px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--dark);
}

.logo span { color: var(--gold); }

/* --- Hero --- */
.hero {
  min-height: calc(100vh - 65px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px;
}

.hero-inner { max-width: 520px; }

.hero-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  padding: 6px 14px;
  background: var(--gold-light);
  border-radius: 100px;
}

.hero-title {
  margin-bottom: 20px;
  color: var(--dark);
}

.hero-subtitle {
  color: var(--grey);
  font-size: 1.05rem;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Album Preview (Hero Visual) --- */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.album-preview {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
}

.album-preview-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.album-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.album-preview-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--dark);
}

.album-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
}

.preview-photo {
  aspect-ratio: 1;
  border-radius: 4px;
}

/* Warm gradient placeholders that look like photos */
.p1 { background: linear-gradient(135deg, #E8D5C4 0%, #C4A882 100%); }
.p2 { background: linear-gradient(135deg, #D4C5B0 0%, #B8956A 100%); }
.p3 { background: linear-gradient(135deg, #C9B89A 0%, #A87850 100%); }
.p4 { background: linear-gradient(135deg, #DDD0BC 0%, #C4A070 100%); }
.p5 { background: linear-gradient(135deg, #E2D4C2 0%, #C8A878 100%); }
.p6 { background: linear-gradient(135deg, #D8C8B2 0%, #B89060 100%); }

.album-preview-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--grey);
}

.gold { color: var(--gold); font-weight: 500; }

/* --- Sections --- */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--white);
}

.section-cta {
  background: var(--dark);
  color: var(--white);
}

.section-title {
  text-align: center;
  margin-bottom: 12px;
}

.section-title.light { color: var(--white); }

.section-subtitle {
  text-align: center;
  color: var(--grey);
  font-size: 1.05rem;
  margin-bottom: 60px;
}

.section-subtitle.light { color: rgba(255,255,255,0.6); }

/* --- Steps (How it Works) --- */
.steps {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.step {
  flex: 1;
  text-align: center;
  padding: 32px 24px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.step-number {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--gold-light);
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--dark);
}

.step-desc {
  color: var(--grey);
  font-size: 0.9rem;
  line-height: 1.6;
}

.step-divider {
  color: var(--gold);
  font-size: 1.5rem;
  padding-top: 50px;
  opacity: 0.5;
}

/* --- Features Grid --- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.feature:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-icon {
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.feature h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--dark);
}

.feature p {
  color: var(--grey);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* --- Footer --- */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.5);
  padding: 32px 24px;
  text-align: center;
}

.footer .logo {
  color: var(--white);
  font-size: 1.2rem;
  display: block;
  margin-bottom: 8px;
}

.footer p { font-size: 0.82rem; }

/* --- Page Header (inner pages) --- */
.page-header {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--dark);
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--grey);
  font-size: 0.95rem;
}

/* --- Form Elements --- */
.form-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--dark);
  background: var(--bg);
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--gold-light);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--grey);
  margin-top: 6px;
}

/* --- QR Code Display --- */
.qr-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
}

.qr-wrapper {
  display: inline-block;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 20px auto;
}

.qr-wrapper canvas, .qr-wrapper img {
  display: block;
}

.qr-event-name {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--dark);
  margin-bottom: 4px;
}

.qr-event-meta {
  color: var(--grey);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
}

.link-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--grey);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}

.copy-btn {
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.copy-btn:hover { background: var(--gold); }
.copy-btn.copied { background: var(--success); }

.qr-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* --- Upload Area --- */
.upload-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.event-banner {
  background: linear-gradient(135deg, var(--dark) 0%, #2d2d2d 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: var(--white);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.event-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: var(--gold);
  opacity: 0.06;
  border-radius: 50%;
}

.event-banner-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.event-banner-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 4px;
}

.event-banner-meta {
  color: rgba(255,255,255,0.5);
  font-size: 0.88rem;
}

.event-banner-message {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  font-style: italic;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  margin-bottom: 24px;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-light);
}

.drop-icon { font-size: 2.5rem; margin-bottom: 16px; }

.drop-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--dark);
  margin-bottom: 8px;
}

.drop-subtitle {
  color: var(--grey);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.drop-formats {
  font-size: 0.75rem;
  color: var(--light-grey);
  letter-spacing: 0.05em;
}

/* --- Preview Grid --- */
.preview-section { margin-bottom: 24px; }

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.preview-count {
  font-size: 0.88rem;
  color: var(--grey);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--light-grey);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --- Upload Progress --- */
.upload-progress {
  margin-bottom: 24px;
  display: none;
}

.progress-bar-wrap {
  background: var(--light-grey);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 100px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.82rem;
  color: var(--grey);
  text-align: center;
}

/* --- Success State --- */
.upload-success {
  text-align: center;
  padding: 48px 32px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: none;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.success-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.success-subtitle {
  color: var(--grey);
  margin-bottom: 24px;
}

/* --- Gallery Page --- */
.gallery-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.gallery-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.gallery-meta {
  display: flex;
  gap: 20px;
}

.meta-item {
  text-align: center;
}

.meta-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--dark);
  line-height: 1;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.gallery-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Photo Grid --- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--light-grey);
  cursor: pointer;
  group: true;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-card:hover img { transform: scale(1.04); }

.photo-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  gap: 6px;
}

.photo-card:hover .photo-card-overlay { opacity: 1; }

.photo-card-btn {
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  cursor: pointer;
  color: var(--dark);
  transition: var(--transition);
}

.photo-card-btn:hover { background: var(--white); }

.photo-card-btn.delete-btn {
  background: rgba(192, 57, 43, 0.85);
  color: white;
}

/* --- Uploader Name Field (upload page) --- */
.uploader-field {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  justify-content: center;
  align-items: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  gap: 16px;
}

.lightbox-img {
  max-width: 80vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-nav {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.lightbox-nav:hover { background: var(--gold); }

.lightbox-footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: center;
}

.lightbox-counter {
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  padding: 6px 14px;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--grey);
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--dark);
  margin-bottom: 8px;
}
.empty-subtitle { font-size: 0.9rem; }

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--dark);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.88rem;
  z-index: 9999;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

/* --- Loading Spinner --- */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--gold-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* --- Demo Banner --- */
.demo-banner {
  background: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 0.82rem;
  color: var(--gold-dark);
  text-align: center;
  margin-bottom: 24px;
}

/* --- Consent Checkbox --- */
.consent-group {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--grey);
}

.consent-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--gold);
  flex-shrink: 0;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 48px 24px;
    gap: 40px;
  }

  .hero-inner { max-width: 100%; }
  .hero-visual { display: none; }

  .steps {
    flex-direction: column;
  }

  .step-divider {
    transform: rotate(90deg);
    padding: 0;
    text-align: center;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .features { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .form-card { padding: 24px; }
  .qr-card { padding: 24px; }
  .gallery-topbar { flex-direction: column; align-items: flex-start; }
  .nav-inner { padding: 14px 16px; }
}
