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

:root {
  --green: #2d6a4f;
  --green-light: #52b788;
  --green-pale: #d8f3dc;
  --brown: #6b4226;
  --bg: #f7f5f0;
  --text: #1b1b1b;
  --muted: #6b7280;
  --border: #d1d5db;
  --red: #dc2626;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.12);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Auth pages */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
}
.auth-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2.5rem 2rem;
  width: 100%; max-width: 400px;
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo h1 { color: var(--green); font-size: 1.8rem; }
.auth-logo p { color: var(--muted); font-size: .9rem; margin-top: .25rem; }

/* Form */
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; }
input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: .65rem .8rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 1rem; transition: border .2s;
  background: var(--white); color: var(--text);
}
input:focus { outline: none; border-color: var(--green-light); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: var(--radius); font-size: 1rem;
  font-weight: 600; cursor: pointer; border: none; transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--green); color: var(--white); width: 100%; }
.btn-primary:hover { opacity: .9; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-outline {
  background: transparent; border: 1.5px solid var(--green);
  color: var(--green);
}
.btn-outline:hover { background: var(--green-pale); }

.alert {
  padding: .75rem 1rem; border-radius: var(--radius);
  font-size: .9rem; margin-bottom: 1rem;
}
.alert-error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.hidden { display: none !important; }

/* Nav */
nav {
  background: var(--green); color: var(--white);
  padding: .75rem 1.5rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
nav .brand { font-size: 1.2rem; font-weight: 700; color: var(--white); text-decoration: none; }
nav .nav-links { display: flex; gap: .5rem; flex-wrap: wrap; }
nav a {
  color: rgba(255,255,255,.85); text-decoration: none;
  padding: .4rem .8rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 500; transition: background .15s;
}
nav a:hover, nav a.active { background: rgba(255,255,255,.15); color: var(--white); }
nav .nav-user { font-size: .85rem; opacity: .75; }

/* Main content */
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--green); }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem; text-align: center; margin-bottom: 1.5rem;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--green-light); background: var(--green-pale);
}
.upload-zone p { color: var(--muted); margin-top: .5rem; font-size: .9rem; }
.upload-zone input { display: none; }

/* File list */
.file-list { display: flex; flex-direction: column; gap: .5rem; }
.file-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1rem;
}
.file-item .file-icon { font-size: 1.5rem; flex-shrink: 0; }
.file-item .file-info { flex: 1; min-width: 0; }
.file-item .file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .file-meta { font-size: .8rem; color: var(--muted); }
.file-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* Photo gallery */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.photo-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .15s;
}
.photo-card:hover { transform: scale(1.02); }
.photo-card img {
  width: 100%; height: 140px; object-fit: cover; display: block;
}
.photo-card .photo-caption {
  padding: .4rem .6rem; font-size: .8rem;
  color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
}
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  color: var(--white); font-size: 2rem; cursor: pointer;
  background: none; border: none; line-height: 1;
}

/* QR code area */
.qr-wrap { text-align: center; margin: 1.5rem 0; }
.qr-wrap canvas { border-radius: var(--radius); border: 4px solid var(--white); box-shadow: var(--shadow); }
.secret-code {
  font-family: monospace; background: var(--green-pale);
  padding: .5rem 1rem; border-radius: var(--radius);
  font-size: 1rem; letter-spacing: .1em; word-break: break-all;
  margin: .75rem 0;
}

/* Progress bar */
.progress-wrap { margin: .5rem 0; }
.progress-bar {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--green-light);
  transition: width .3s; width: 0%;
}

@media (max-width: 600px) {
  .auth-card { padding: 1.5rem 1rem; }
  nav { flex-direction: column; align-items: flex-start; }
}
