:root {
  color-scheme: dark;
  --bg-start: #b9e6ff;
  --bg-end: #68c8ef;
  --surface: rgba(255, 255, 255, 0.32);
  --surface-strong: rgba(255, 255, 255, 0.46);
  --accent: #3cd1ff;
  --accent-dark: #92ddff;
  --text: #0e2f4d;
  --text-muted: rgba(14, 47, 77, 0.75);
  --border: rgba(255, 255, 255, 0.45);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, sans-serif;
  background: url("assets/acqua.jpg") center/cover fixed no-repeat,
              radial-gradient(circle at top, rgba(255, 255, 255, 0.9), transparent 22%),
              linear-gradient(180deg, var(--bg-start), var(--bg-end));
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.page {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 28px;
  backdrop-filter: blur(22px);
  background: rgba(255, 255, 255, 0.75);
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(14, 47, 77, 0.12);
}

.hero-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-left, .hero-right {
  gap: 0.75rem;
}

.icon {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(255,255,255,0.72);
  position: relative;
  overflow: hidden;
}

.icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compass {
  border: 1px solid rgba(255,255,255,0.22);
}

.compass .circle {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 50%;
}

.pointer {
  position: absolute;
  width: 12px;
  height: 4px;
  background: var(--accent);
  border-radius: 999px;
}

.pointer.north { top: 10%; left: 50%; transform: translateX(-50%); width: 14px; height: 6px; }
.pointer.east { right: 10%; top: 50%; transform: translateY(-50%) rotate(90deg); }
.pointer.south { bottom: 10%; left: 50%; transform: translateX(-50%); width: 14px; height: 6px; }
.pointer.west { left: 10%; top: 50%; transform: translateY(-50%) rotate(90deg); }

.nuraghe {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 68px;
  height: 68px;
  padding: 10px;
}

.nuraghe .tower {
  background: linear-gradient(180deg, #f8f8f2 0%, #e6c86b 100%);
  border-radius: 12px 12px 4px 4px;
}

.nuraghe .tower:nth-child(1) { height: 44px; }
.nuraghe .tower:nth-child(2) { height: 52px; }
.nuraghe .tower:nth-child(3) { height: 40px; }

.nuraghe .top {
  grid-column: 1 / -1;
  height: 8px;
  background: #f8f8f2;
  border-radius: 4px;
  margin-top: 2px;
}

.logo-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-center h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0;
}

.content {
  padding: 1rem 0 0;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
  background-image: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72)), url("assets/bckg_2.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.section-photos {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}

.photo-card {
  display: grid;
  justify-items: center;
  gap: 1rem;
}

.photo-link {
  width: min(820px, 100%);
  text-decoration: none;
  border: none;
  background: transparent;
}

.photo {
  min-height: 360px;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow: none;
  border: none;
  background: transparent;
}

.photo-label {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1rem;
  z-index: 2;
}

.photo-night {
  background: radial-gradient(circle at top left, #cbf2ff 0%, #7cc8ea 40%, #3c92c1 100%);
}

.photo-day {
  background: radial-gradient(circle at top right, #e7ffff 0%, #9bd9f4 30%, #5fa9cd 80%);
}

.sky-stars {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.8) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
}

.sun {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  top: 2.5rem;
  right: 2.5rem;
  background: radial-gradient(circle, #fff9b8 0%, rgba(255,255,255,0.1) 60%, transparent 100%);
  box-shadow: 0 0 70px rgba(255, 232, 131, 0.6);
}

.moon {
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  top: 2.5rem;
  right: 2.5rem;
  background: radial-gradient(circle, #f7f7e7 0%, #cfd7e5 100%);
  box-shadow: 0 0 18px rgba(255,255,255,0.4);
}

.island {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 78%;
  height: 40%;
  background: linear-gradient(180deg, #577f5f 0%, #1f441f 100%);
  border-radius: 48% 52% 30% 30% / 18% 20% 82% 82%;
}

.island-day {
  background: linear-gradient(180deg, #86a168 0%, #2f5f2f 100%);
}

.flags {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.flags a {
  width: 3rem;
  height: 3rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  text-decoration: none;
  background: rgba(255,255,255,0.18);
  color: #0f3c5d;
  font-size: 1.5rem;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 10px rgba(15, 60, 93, 0.15);
}

.flags a:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.3);
  box-shadow: 0 10px 16px rgba(15, 60, 93, 0.22);
}

button, .button-link {
  appearance: none;
  border: none;
  padding: 0.95rem 1.5rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #3cd1ff, #1fa8d9);
  color: #042a3c;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(30, 120, 170, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover, .button-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 25px rgba(30, 120, 170, 0.28);
}

.bottom-menu {
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.footer-image {
  width: 94px;
  height: 94px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.72);
  display: grid;
  place-items: center;
}

.footer-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  justify-self: center;
}

@media (max-width: 680px) {
  .bottom-menu {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-image {
    margin: 0 auto;
  }
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--accent);
}

.admin-panel {
  margin-top: 2rem;
  padding: 1.75rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(14, 47, 77, 0.12);
}

.admin-inner {
  max-width: 760px;
  margin: 0 auto;
}

.admin-page-panel {
  background: rgba(255,255,255,0.94);
}

.admin-hero {
  background: rgba(255, 255, 255, 0.56);
  border-radius: 24px;
  margin-bottom: 1.5rem;
  color: #0f3c5d;
}

.admin-hero h1 {
  margin: 0;
}

.admin-hero p {
  margin: 0.75rem 0 0;
}

.admin-panel h2 {
  margin-top: 0;
}

.is-hidden {
  display: none;
}

.auth-form {
  display: grid;
  gap: 0.5rem;
}

.auth-message {
  min-height: 1.25rem;
  margin: 0.25rem 0 0;
  color: #0f3c5d;
  font-weight: 600;
}

.auth-message-error {
  color: #b42318;
}

.form-row {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-row label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.form-row input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

button {
  appearance: none;
  border: none;
  padding: 0.95rem 1.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #69e1ff, #24b1dc);
  color: #04314a;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

@media (max-width: 840px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-left, .hero-right {
    flex-direction: row;
    justify-content: center;
  }

  .photo {
    min-height: 300px;
  }

  .bottom-menu {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-nav {
    justify-content: flex-start;
  }
}
