:root {
  --bg: #0f172a;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-2: rgba(30, 41, 59, 0.82);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #38bdf8;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.16), transparent 24%),
    linear-gradient(135deg, #0f172a, #111827 55%, #1e293b);
  min-height: 100vh;
}

.page {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.auth-card,
.admin-panel,
.topbar {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(420px, 100%);
  margin: 8vh auto 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

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

.tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  background-size: cover;
  background-position: center;
}

.tile:hover {
  transform: translateY(-5px) scale(1.01);
  filter: brightness(1.06);
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.2), rgba(0,0,0,.58));
}

.tile__title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 700;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.hidden { display: none; }
.muted { color: var(--muted); }

form {
  display: grid;
  gap: 12px;
}

label {
  font-size: 0.95rem;
  color: var(--muted);
}

input, select, button {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 15px;
}

input, select {
  background: rgba(255,255,255,.06);
  color: white;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #082f49;
  font-weight: 700;
}

.admin-panel {
  margin-top: 28px;
  padding: 24px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tile-card-admin {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tile-card-admin button,
#tile-form-reset {
  background: rgba(255,255,255,.92);
  color: #0f172a;
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.admin-divider {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--border);
}