@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&display=swap');

:root {
  --bg: #060d18;
  --surface: #0a1a2e;
  --surface-2: #0f2544;
  --text: #f4f7ff;
  --muted: #8ba3c7;
  --accent: #1a5cff;
  --accent-2: #5eb3ff;
  --border: rgba(46, 123, 255, 0.18);
  --ok: #3ecf8e;
  --error: #ff6b6b;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

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

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(26, 92, 255, 0.18), transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(94, 179, 255, 0.1), transparent 36%);
  pointer-events: none;
}

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

.wrap {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}

.brand-uni { color: var(--accent-2); }
.brand-confesiones { color: var(--text); }

.toplink {
  font-size: 0.92rem;
  color: var(--muted);
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: 0.2s ease;
}

.toplink:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.hero {
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 0.75rem;
  font-weight: 800;
}

.hero p {
  color: var(--muted);
  max-width: 52ch;
}

.card {
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  gap: 1.25rem;
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 500;
}

.label-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.88rem;
}

textarea,
input[type="password"],
input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 0.85rem 1rem;
  font: inherit;
  resize: vertical;
}

textarea:focus,
input:focus {
  outline: 2px solid rgba(26, 92, 255, 0.45);
  border-color: transparent;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: 0.2s ease;
  background: var(--surface);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(26, 92, 255, 0.08);
}

.dropzone input { display: none; }

.dropzone strong { display: block; margin-bottom: 0.35rem; }

.dropzone span { color: var(--muted); font-size: 0.9rem; }

.preview {
  margin-top: 1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 320px;
  display: none;
}

.preview.visible { display: block; }

.preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #000;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-danger {
  background: rgba(255, 107, 107, 0.12);
  color: #ffb4b4;
  border: 1px solid rgba(255, 107, 107, 0.25);
}

.status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  display: none;
}

.status.visible { display: block; }

.status.ok {
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.25);
  color: #b8f5d8;
}

.status.error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.25);
  color: #ffc9c9;
}

.success-box {
  text-align: center;
  padding: 2rem 1rem;
}

.success-box h2 {
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.success-box p { color: var(--muted); }

.admin-login {
  max-width: 420px;
  margin: 4rem auto 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-stats {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.admin-storage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.admin-storage-item {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.admin-storage-item--accent {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter-btn.active {
  color: var(--text);
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent);
}

.gallery-row-top {
  margin-bottom: 0.5rem;
}

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill--pending {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.status-pill--published {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.status-pill--archived {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.gallery-item--pending {
  border-left: 3px solid #fbbf24;
}

.gallery-item--published {
  border-left: 3px solid #34d399;
}

.gallery-item--archived {
  opacity: 0.85;
  border-left: 3px solid #64748b;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.gallery {
  display: grid;
  gap: 1rem;
}

.gallery-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

@media (max-width: 640px) {
  .gallery-item {
    grid-template-columns: 1fr;
  }
}

.gallery-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020810;
}

.gallery-thumb--text {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}

.gallery-thumb-text {
  font-size: 2rem;
  line-height: 1;
}

.gallery-thumb-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gallery-body h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gallery-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.gallery-countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin: -0.35rem 0 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  font-size: 0.82rem;
}

.gallery-countdown-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  color: #fbbf24;
}

.gallery-countdown-time {
  font-weight: 700;
  color: var(--text);
}

.gallery-countdown-date {
  color: var(--muted);
  font-size: 0.78rem;
}

.gallery-countdown--hint {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.22);
}

.gallery-countdown--hint .gallery-countdown-label {
  color: #94a3b8;
}

.deletion-log {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.deletion-log h2 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.deletion-log-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.deletion-log-list {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.deletion-log-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.deletion-log-text {
  font-weight: 600;
  line-height: 1.35;
}

.deletion-log-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.hidden { display: none !important; }

.mobile-save-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
}

.mobile-save-card {
  width: min(100%, 420px);
  max-height: 92vh;
  overflow: auto;
  padding: 1rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.mobile-save-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.mobile-save-hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
}

.mobile-save-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 0.85rem;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: default;
}

.mobile-save-close {
  width: 100%;
}
