/* ===== Downloads & Admin ===== */
.downloads-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.downloads-main {
  flex: 1;
  padding-top: var(--header-height);
}

.nav-links .active {
  color: var(--color-accent);
}

.hidden {
  display: none !important;
}

/* Access gate */
.access-gate {
  min-height: calc(100vh - var(--header-height) - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  background: linear-gradient(180deg, #fcfbf8 0%, #f7f2e9 100%);
  overflow: hidden;
}

.access-gate::before,
.access-gate::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.16;
}

.access-gate::before {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(184, 149, 106, 0.22), transparent 65%);
  top: -100px;
  left: -70px;
}

.access-gate::after {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(33, 33, 33, 0.08), transparent 65%);
  bottom: -80px;
  right: -90px;
}

.access-card {
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.98);
  padding: 54px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.08);
  text-align: center;
  border-radius: 30px;
  border: 1px solid rgba(184, 149, 106, 0.18);
  position: relative;
  z-index: 1;
}

.access-card::before {
  content: '';
  position: absolute;
  top: 24px;
  right: 24px;
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background: rgba(184, 149, 106, 0.1);
}

.access-card::after {
  content: '';
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(33, 33, 33, 0.05);
}

.access-card h1 {
  font-size: clamp(2rem, 3vw, 2.4rem);
  margin-bottom: 18px;
}

.access-desc {
  color: var(--color-muted);
  margin-bottom: 32px;
  font-size: 0.95rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.access-form {
  text-align: left;
}

.access-form .form-group {
  margin-bottom: 28px;
}

.access-form input {
  width: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(184, 149, 106, 0.35);
  background: #f7f2e8;
  font-size: 1rem;
  color: var(--color-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.access-form input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.12);
}

.access-form label {
  font-size: 0.85rem;
  color: var(--color-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
}

.access-error {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

.access-error {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

.btn--outline {
  background: transparent;
  color: var(--color-dark);
}

.btn--outline:hover {
  background: var(--color-dark);
  color: #fff;
}

/* Upload section */
.upload-section {
  min-height: calc(100vh - var(--header-height) - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.upload-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  padding: 48px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.upload-card h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.upload-desc {
  color: var(--color-muted);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.upload-form {
  text-align: left;
}

.file-hint {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 8px;
}

.upload-status {
  font-size: 0.85rem;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

.upload-status.success {
  color: #27ae60;
}

.upload-status.error {
  color: #c0392b;
}

/* Album view */
.album-view {
  padding: 60px 0 80px;
}

.album-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.album-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.album-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.download-item {
  background: #fff;
  border: 1px solid #e0ddd8;
  overflow: hidden;
  transition: var(--transition);
}

.download-item:hover {
  border-color: var(--color-accent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.download-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f0ede8;
}

.download-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.download-info {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.download-name {
  font-size: 0.8rem;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.download-btn:hover {
  background: var(--color-accent-dark);
}

/* Admin */
.admin-page .downloads-main {
  background: #f0ede8;
}

.admin-panel {
  padding: 48px 0 80px;
}

.admin-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.admin-top h2 {
  font-size: 2rem;
}

.admin-hint {
  color: var(--color-muted);
  margin-top: 8px;
}

.admin-card {
  background: #fff;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.admin-card h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.album-admin-card {
  background: #fff;
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.album-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.album-admin-header h3 {
  font-size: 1.4rem;
}

.album-admin-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.album-admin-meta span {
  color: var(--color-muted);
}

.album-admin-meta strong {
  color: var(--color-accent);
}

.album-admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn--small {
  padding: 8px 20px;
  font-size: 0.7rem;
}

.btn--danger {
  background: transparent;
  color: #c0392b;
  border-color: #c0392b;
}

.btn--danger:hover {
  background: #c0392b;
  color: #fff;
}

.admin-images-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.admin-image-item {
  position: relative;
  border: 1px solid #e0ddd8;
  aspect-ratio: 1;
  overflow: hidden;
}

.admin-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-image-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.admin-folder-hint {
  background: #faf9f7;
  border-left: 3px solid var(--color-accent);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 12px;
}

.admin-save-bar {
  position: sticky;
  bottom: 0;
  background: var(--color-dark);
  color: #fff;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.admin-save-bar p {
  font-size: 0.9rem;
  opacity: 0.8;
}

.admin-save-bar .btn {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.admin-save-bar .btn:hover {
  background: transparent;
  color: #fff;
}

@media (max-width: 768px) {
  .access-card {
    padding: 32px 24px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .album-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
