:root {
  --paper: #f4f5f6;
  --ink: #1f2328;
  --ink-soft: #5b6572;
  --accent: #3a5f7d;
  --accent-dark: #2c4a63;
  --card: #ffffff;
  --border: #dde1e6;
  --body-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.5;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent-dark);
  font-weight: 600;
  margin: 0 0 0.4rem;
}

h1 {
  font-weight: 600;
  font-size: 1.8rem;
  margin: 0;
  color: var(--ink);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

/* --- Login page --- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem 2.25rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(31, 35, 40, 0.08);
}

.login-copy {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0.9rem 0 1.5rem;
}

.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
}

.login-form input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--body-font);
  background: var(--paper);
  color: var(--ink);
}

.login-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.login-form button {
  margin-top: 1.1rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-form button:hover { background: var(--accent-dark); }
.login-form button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.login-error {
  color: #b3261e;
  font-size: 0.85rem;
  margin-top: 1rem;
  text-align: center;
}

/* --- Gallery page --- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2.5rem 5vw 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.logout-link {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.logout-link:hover { color: var(--ink); border-color: var(--ink-soft); }

.upload-zone {
  position: relative;
  margin: 0 5vw 2.5rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}

.upload-zone.drag-over { border-color: var(--accent); background: #fbfcfd; }

.upload-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.5rem 0 0.2rem;
}

.upload-hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.upload-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.upload-button:hover { background: var(--accent-dark); }

.upload-status {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 5vw 1.2rem;
}

.gallery-count {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.download-all-button {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.download-all-button:hover { background: var(--accent); color: #fff; }

.wall {
  column-count: 4;
  column-gap: 1.5rem;
  padding: 0 5vw 3rem;
}

@media (max-width: 1100px) { .wall { column-count: 3; } }
@media (max-width: 720px) { .wall { column-count: 2; } }
@media (max-width: 460px) { .wall { column-count: 1; } }

.photo-card {
  break-inside: avoid;
  background: #fff;
  padding: 0.4rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(31, 35, 40, 0.08);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 24px rgba(31, 35, 40, 0.14);
  z-index: 2;
}

.photo-card img {
  width: 100%;
  display: block;
  border-radius: 3px;
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 2rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(17, 20, 24, 0.92);
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  z-index: 10;
}

.lightbox:not([hidden]) {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-download {
  position: absolute;
  top: 1.2rem;
  left: 1.5rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox-download:hover,
.lightbox-download:focus-visible { background: rgba(255, 255, 255, 0.24); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible { background: rgba(255, 255, 255, 0.24); }

.lightbox-nav[hidden] { display: none; }

.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

@media (max-width: 640px) {
  .lightbox-nav { width: 2.6rem; height: 2.6rem; font-size: 1.7rem; }
  .lightbox-prev { left: 0.3rem; }
  .lightbox-next { right: 0.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-card, .upload-button, .login-form button { transition: none; }
}
