:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2a37;
  --text-muted: #6b7280;
  --border: rgba(15, 23, 42, 0.08);
  --accent: #3967ff;
  --accent-dark: #0f42cb;
  --gradient: linear-gradient(120deg, #3c8bff, #9e35ff, #ff3dd1);
  --radius-lg: 32px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 20px 50px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 24px 45px rgba(41, 53, 108, 0.08);
  --font-heading: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.login-page {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 64px);
}

.ambient-shape {
  position: absolute;
  width: clamp(280px, 35vw, 520px);
  height: clamp(280px, 35vw, 520px);
  border-radius: 48% 52% 58% 42%;
  background: linear-gradient(160deg, rgba(60, 139, 255, 0.15), rgba(158, 53, 255, 0.12));
  filter: blur(0px);
  z-index: 0;
}

.shape-one {
  top: -10%;
  left: -8%;
}

.shape-two {
  bottom: -12%;
  right: -10%;
}

.shape-three {
  top: 20%;
  right: 5%;
  width: clamp(160px, 18vw, 220px);
  height: clamp(160px, 18vw, 220px);
  background: linear-gradient(140deg, rgba(255, 61, 209, 0.18), rgba(60, 139, 255, 0.25));
}

.login-wrapper {
  width: min(960px, 100%);
  z-index: 1;
}

.login-card {
  background: var(--card);
  padding: clamp(32px, 5vw, 56px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 32px;
}

.login-card__header {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-mark {
  width: clamp(120px, 18vw, 200px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.login-card__header h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.login-form {
  display: grid;
  gap: 20px;
}

.form-control {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.form-control span {
  color: var(--text-muted);
  font-weight: 500;
}

.form-control input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: #fdfdff;
  transition: border 200ms ease, box-shadow 200ms ease;
}

.form-control input:focus {
  outline: none;
  border-color: rgba(60, 139, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(60, 139, 255, 0.12);
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  width: 100%;
  padding-right: 72px;
}

.form-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.outline-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  padding: 10px 18px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border 200ms ease, color 200ms ease, background 200ms ease;
}

.outline-btn:hover {
  border-color: rgba(57, 103, 255, 0.6);
  color: var(--accent-dark);
  background: rgba(57, 103, 255, 0.08);
}

.outline-btn--danger {
  border-color: rgba(185, 28, 28, 0.35);
  color: #b91c1c;
}

.outline-btn--danger:hover {
  border-color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}

.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  flex-wrap: wrap;
  gap: 16px;
}

.checkbox {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
  color: var(--text-muted);
}

.checkbox input {
  accent-color: #3967ff;
}

.ghost-link {
  color: var(--accent);
  font-weight: 600;
}

.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  background-image: var(--gradient);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 12px 25px rgba(57, 103, 255, 0.35);
}

.primary-btn:active {
  transform: translateY(1px);
}

.form-feedback {
  min-height: 20px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.login-card__footer {
  text-align: center;
  color: var(--text-muted);
}

/* Dashboard */

.dashboard-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.sidebar__brand img {
  width: 100%;
}

.sidebar__brand span {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.15em;
}

.nav-section {
  margin-bottom: 32px;
}

.nav-section label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-list {
  list-style: none;
  padding: 16px 0 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.nav-list li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background 150ms ease, color 150ms ease;
}

.nav-list li a svg {
  width: 20px;
  height: 20px;
}

.nav-list li a.active,
.nav-list li a:hover {
  background: rgba(57, 103, 255, 0.08);
  color: var(--accent-dark);
}

.nav-pill {
  font-size: 0.7rem;
  background: rgba(255, 61, 209, 0.2);
  color: #b8208a;
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: auto;
}

.upgrade-card {
  margin-top: auto;
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(60, 139, 255, 0.13), rgba(158, 53, 255, 0.13));
}

.upgrade-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
}

.content-shell {
  background: #fdfdff;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.search-field {
  position: relative;
}

.search-field input {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px 10px 40px;
}

.search-field svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0f4ff;
  border-radius: 999px;
  padding: 6px 12px;
}

.logout-form {
  margin: 0;
}

.logout-form button {
  white-space: nowrap;
}

.dashboard-main {
  padding: 32px;
  display: grid;
  gap: 32px;
  flex: 1;
}

.dashboard-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.kpi-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.kpi-value {
  margin: 10px 0 0;
  font-family: var(--font-heading);
  font-size: 1.75rem;
}

.data-panels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.panel h3 {
  margin: 0 0 18px;
  font-size: 1.1rem;
}

.chart-placeholder {
  height: 260px;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(
      90deg,
      rgba(57, 103, 255, 0.08),
      rgba(57, 103, 255, 0.08) 2px,
      transparent 2px,
      transparent 24px
    ),
    linear-gradient(160deg, rgba(57, 103, 255, 0.08), rgba(255, 61, 209, 0.12));
  position: relative;
  overflow: hidden;
}

.chart-placeholder::after {
  content: "";
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.9), transparent 45%);
  opacity: 0.5;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.12);
}

.activity-list span:last-child {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive Tablette - Sidebar fine avec icones + textes */
@media (max-width: 1100px) {
  .dashboard-page {
    grid-template-columns: 82px 1fr;
  }
  .sidebar {
    padding: 24px 12px;
  }
  .sidebar__brand {
    justify-content: center;
  }
  .sidebar__brand img {
    width: 42px;
  }
  .sidebar__brand span,
  .nav-section label {
    display: none;
  }
  .nav-list li a {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    text-align: center;
  }
  .nav-list li a svg {
    width: 22px;
    height: 22px;
  }
  .nav-list li a span {
    display: block !important;
    font-size: 0.65rem;
    line-height: 1.1;
  }
  .nav-pill {
    display: none;
  }
  .data-panels {
    grid-template-columns: 1fr;
  }
}

/* Responsive Smartphone - même sidebar fine que tablette */
@media (max-width: 640px) {
  .dashboard-page {
    grid-template-columns: 70px 1fr;
  }
  .sidebar {
    padding: 20px 8px;
  }
  .sidebar__brand img {
    width: 36px;
  }
  .nav-list li a {
    padding: 8px 4px;
    gap: 3px;
  }
  .nav-list li a svg {
    width: 20px;
    height: 20px;
  }
  .nav-list li a span {
    font-size: 0.55rem;
  }
  .top-bar {
    padding: 12px 16px;
  }
  .top-bar h1 {
    font-size: 1.1rem;
  }
  .top-bar__actions {
    gap: 8px !important;
  }
  .primary-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .user-pill {
    display: none;
  }
  .logout-form button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .kpi-card {
    padding: 14px;
  }
  .kpi-value {
    font-size: 1.4rem;
  }
  .dashboard-main {
    padding: 16px;
  }
  .panel {
    padding: 18px;
  }
  .chart-placeholder {
    height: 180px;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 28px;
  }
  .login-card__header {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== Module Galerie Photos ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.alert-success {
  background: #d1fae5;
  color: #065f46;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.form-panel {
  max-width: 640px;
}
.gallery-form .form-group,
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}
.form-group label {
  font-weight: 600;
  margin-bottom: 8px;
}
.form-group input[type="text"],
.form-group textarea,
.form-group input[type="file"] {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}
.form-group textarea {
  resize: vertical;
}
.form-group .hint {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Grille des galeries */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.gallery-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-self: start;
  height: fit-content;
}
.gallery-card__cover {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #eef1f8;
  overflow: hidden;
}
.gallery-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 250ms ease;
}
.gallery-card__cover:hover img {
  transform: scale(1.04);
}
.gallery-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.gallery-card__count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
}
.gallery-card__body {
  padding: 16px 18px 4px;
}
.gallery-card__body h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.gallery-card__body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.gallery-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 18px;
}
.gallery-card__actions .outline-btn {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.data-table td.actions {
  text-align: right;
  white-space: nowrap;
}

/* Filtres et titres de catégories */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
  padding: 14px;
  background: #f6f7fb;
  border-radius: 14px;
}
.category-filter__item {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: all 150ms ease;
}
.category-filter__item:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.category-filter__item.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.category-heading {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

/* En-tête galerie */
.gallery-header {
  margin-bottom: 22px;
}
.back-link {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
}
.gallery-header__desc {
  margin: 10px 0 0;
  color: var(--text-muted);
}
.gallery-header__category {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
}
.gallery-header__category:hover {
  opacity: 0.9;
}

/* Zone d'upload */
.upload-panel {
  margin-bottom: 28px;
}
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 36px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(57, 103, 255, 0.05);
}
.dropzone__title {
  font-weight: 600;
  color: var(--text);
}
.dropzone__hint {
  font-size: 0.82rem;
}
.dropzone__files {
  font-size: 0.85rem;
  color: var(--accent-dark);
  font-weight: 600;
}

/* Grille des photos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.photo-item {
  position: relative;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.photo-item.is-cover {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.photo-item__img {
  display: block;
  aspect-ratio: 1 / 1;
  background: #eef1f8;
}
.photo-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-badge {
  position: absolute;
  top: 8px;
  left: 66px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.photo-item figcaption {
  padding: 8px 10px 10px;
}
.photo-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.photo-actions form {
  margin: 0;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: rgba(57, 103, 255, 0.06);
}
.icon-btn--danger:hover {
  border-color: #b91c1c;
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}

.upload-progress {
  margin-top: 16px;
  background: rgba(57, 103, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
}
.upload-progress__bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-progress__bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 200ms ease;
}
.upload-progress__text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.upload-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-preview-item__icon {
  color: var(--text-muted);
}
.upload-preview-item__name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  font-size: 0.65rem;
  color: #fff;
  background: rgba(0,0,0,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-preview-item__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0,0,0,0.2);
}
.upload-preview-item__progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 150ms ease;
}
.upload-preview-item__status {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.upload-preview-item__status--success {
  color: #16a34a;
}
.upload-preview-item__status--error {
  color: #dc2626;
}
.upload-preview-item__status--wait {
  color: var(--text-muted);
}

.photo-grid-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.photo-grid-toolbar__select {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  user-select: none;
}
.photo-grid-toolbar__select input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.photo-item {
  position: relative;
}
.photo-item__checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,0.85);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: background 150ms ease;
}
.photo-item__checkbox:hover {
  background: #fff;
}
.photo-item__checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.photo-item.is-selected {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: 10px;
}
.photo-item.is-selected .photo-item__img img {
  opacity: 0.75;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 200ms ease;
}
.lightbox-overlay:not([hidden]) {
  opacity: 1;
}
.lightbox-overlay[hidden] {
  display: none;
}
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}
.lightbox__close:hover {
  background: rgba(255,255,255,0.3);
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}
.lightbox__nav:hover {
  background: rgba(255,255,255,0.3);
}
.lightbox__nav--prev {
  left: 16px;
}
.lightbox__nav--next {
  right: 16px;
}
.lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
  background: rgba(0,0,0,0.4);
  padding: 6px 14px;
  border-radius: 20px;
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }
  .form-actions {
    flex-direction: column-reverse;
  }
  .form-actions .primary-btn,
  .form-actions .outline-btn {
    width: 100%;
    text-align: center;
  }
}
