/* =========================================
   GLOBAL VARIABLES & DARK THEME
   ========================================= */
:root {
  --bg: #f2f4f8;
  --bg-gradient: linear-gradient(180deg, #f7f9fc 0%, #f2f4f8 55%, #eceff3 100%);
  --blue: #2f4360;
  --red: #c24d2e;
  --yellow: #d98d2f;
  --text: #252525;

  --surface: #ffffff;
  --muted: rgba(49, 70, 98, 0.12);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  --header-height: 72px;
}

body.dark-mode {
  --bg: #1b1b1b;
  --text: #f2f2f2;
  --blue: #1f3048;
  --red: #ff7750;
  --yellow: #f2b866;
  --surface: #242424;
  --muted: rgba(255, 255, 255, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.dark-mode {
  background: var(--bg);
}

html.dark-preload {
  --bg: #1b1b1b;
  --text: #f2f2f2;
  --blue: #a8c7ff;
  --red: #ff7750;
  --yellow: #f2b866;
}

/* =========================================
   RESET & BASE
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding-top: var(--header-height);
  background: var(--bg-gradient);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body:not(.dark-mode) {
  background-image:
    var(--bg-gradient),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat;
  background-size: cover, 220px 220px;
  background-attachment: fixed, fixed;
}

body.dark-mode {
  background: var(--bg);
  background-image: none;
}

.favorite-login-note {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(255,255,255,0.92);
  color: var(--red);
  border: 1px solid rgba(49, 70, 98, 0.18);
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}
.favorite-login-note.visible {
  opacity: 1;
  transform: translateY(0);
}
body.dark-mode .favorite-login-note {
  background: rgba(36,36,36,0.92);
  color: #ff7750;
  border-color: rgba(255,255,255,0.12);
}

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

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

.hidden {
  display: none !important;
}

#main-content {
  flex: 1;
}

/* Utility buttons */
.primary-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 6px 18px rgba(49, 70, 98, 0.2);
}
.primary-btn:hover {
  background: var(--yellow);
  color: var(--blue);
  transform: translateY(-1px);
}
.primary-btn:active {
  background: var(--red);
  color: #fff;
  transform: translateY(0);
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
.page-title {
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.6rem 0;
}

.diy-lede,
.hero-text,
.learn-description,
#about-page p {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* =========================================
   LAYOUT ELEMENTS
   ========================================= */
.section-divider {
  width: 100%;
  height: 2px;
  background: var(--blue);
  opacity: 0.4;
  margin: 0 0 0.6rem 0;
}
.section-divider:first-of-type {
  display: none;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1400;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.35rem 0.75rem 1.35rem;
  background: linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.62),
      rgba(255, 255, 255, 0.52)
    );
  border-bottom: 1px solid var(--muted);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-radius: 0 0 18px 18px;
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

#main-header.index-page {
  box-shadow: none;
}

#main-header.scrolled {
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.14);
}

.logo-title-container {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.site-logo {
  height: 34px;
  width: auto;
  transition: transform 0.2s ease;
}
.site-logo:hover {
  transform: scale(1.04);
}

.site-title {
  font-family: 'Barriecito', cursive;
  font-size: 1.7rem;
  color: #1f3048;
  margin: 0;
  cursor: pointer;
  line-height: 1;
}

#main-index ul {
  display: flex;
  list-style: none;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  align-items: center;
}

#main-index a {
  position: relative;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0.65rem;
  color: #1f3048;
  border-radius: 10px;
  transition: color 0.2s ease, transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
body.dark-mode #main-index a {
  color: #1f3048;
  text-shadow: none;
  box-shadow: none;
  transform: none;
}
#main-index a:hover {
  color: var(--red);
  transform: translateY(-1px);
  background: rgba(49, 70, 98, 0.08);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
#main-index a.current {
  color: var(--red);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.theme-btn {
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.6rem;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--blue);
  transition: color 0.2s ease, transform 0.1s ease, background 0.2s ease;
  padding: 0.3rem;
  border-radius: 10px;
}
.theme-btn:hover {
  color: var(--red);
  background: rgba(49, 70, 98, 0.08);
}
body.dark-mode .theme-btn {
  color: var(--yellow);
}

.pill {
  display: inline-block;
  padding: 0.4rem 0.95rem !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border 0.2s ease;
}
.pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}
.pill:active {
  transform: translateY(0);
}
.pill-blue {
  background: var(--blue);
  color: #fff !important;
  border: 1px solid var(--blue);
}
.pill-blue:hover {
  background: var(--yellow);
  color: var(--blue) !important;
  border-color: var(--yellow);
}
.pill-outline {
  background: #fff;
  color: var(--blue) !important;
  border: 1px solid var(--blue);
}
.pill-outline:hover {
  background: rgba(255,255,255,0.9);
  color: var(--red) !important;
  border-color: var(--red);
}

/* =========================================
   HERO SECTION
   ========================================= */
#hero-section {
  text-align: center;
  padding: 1rem 10%;
}
.hero-title {
  font-family: 'Barriecito', cursive;
  font-size: 1.8rem;
  color: var(--red);
  margin: 0 0 0.45rem 0;
}
.hero-title span {
  color: var(--yellow);
}
.hero-text {
  max-width: 720px;
  margin: 0 auto 0.8rem auto;
}
.hero-button {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.5rem 1.2rem;
  background: var(--blue);
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.25s ease, transform 0.15s ease;
  box-shadow: 0 8px 22px rgba(49, 70, 98, 0.25);
}
.hero-button:hover {
  background: var(--yellow);
  color: var(--blue);
  transform: translateY(-1px);
}
.hero-button:active {
  background: var(--red);
  color: #fff;
  transform: translateY(0);
}

/* =========================================
   SLIDER
   ========================================= */
#country-slider {
  position: sticky;
  top: var(--header-height);
  z-index: 1200;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: min(1180px, 96%);
  margin: 0.2rem auto 1rem auto;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(49, 70, 98, 0.14);
  border-radius: 22px;
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  isolation: isolate;
}

.slider-window {
  width: 100%;
  padding: 0.5rem 0 1rem 0;
  margin-bottom: -0.5rem; /* allow glow to show without growing box */
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 16px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-snap-stop: always;
  -webkit-overflow-scrolling: touch;
  mask-image: none;
}
.slider-window::-webkit-scrollbar { display: none; }

.slider-track {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  scroll-behavior: smooth;
  animation: sliderFade 0.45s ease;
}

.country-item {
  display: inline-block;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(49, 70, 98, 0.12);
  font-size: 0.96rem;
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
  padding: 0.52rem 1.15rem;
  border-radius: 32px;
  box-shadow: none;
  filter: none;
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
              color 0.2s ease,
              box-shadow 0.2s ease,
              background 0.2s ease;
  opacity: 1;
  transform: translateY(0);
}
.slider-track.slider-ready .country-item {
  animation: pillFade 0.4s ease forwards;
  animation-delay: var(--i, 0s);
}
.country-item:hover {
  color: var(--red);
  transform: translateY(-3px) scale(1.05);
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(49, 70, 98, 0.08);
}
.country-item.selected {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #d5653a);
  box-shadow:
    0 12px 26px rgba(189, 67, 27, 0.24),
    0 0 0 1px rgba(189, 67, 27, 0.22);
  transform: translateY(-2px);
}
.country-item:active {
  transform: translateY(-1px) scale(0.99);
}

.dot { display: none; }

.slider-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(49, 70, 98, 0.18);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}
.slider-arrow:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(255, 255, 255, 0.9);
  color: var(--red);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.16);
}
.slider-arrow:active {
  transform: translateY(0) scale(0.96);
}

@keyframes sliderFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pillFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   LEARN PAGE: FLAGS GRID & CARDS
   ========================================= */
#learn-intro {
  max-width: 800px;
  margin: 0.5rem auto 1rem auto;
  padding: 0 10%;
  text-align: center;
}

#flags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.4rem;
  padding: 0 10% 2.5rem 10%;
}

.country-card {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  padding: 0.9rem;
  border: 1px solid var(--muted);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08);
}
body.dark-mode .country-card {
  color: #fff;
  border: none;
  text-shadow: none;
}
.country-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.12);
  border-color: rgba(49, 70, 98, 0.25);
}

.flag {
  width: 100%;
  border-radius: 10px;
  transition: filter 0.3s ease, transform 0.25s ease;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.country-card:hover .flag {
  filter: blur(4px) brightness(96%);
  transform: scale(1.04);
}

.fact {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--blue);
  opacity: 0;
  pointer-events: none;
  -webkit-text-stroke: 0.15px #fff;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(-10px);
}
body.dark-mode .fact {
  color: #fff;
  -webkit-text-stroke: 0;
}
.country-card:hover .fact {
  opacity: 1;
  transform: translateY(0);
}

.music-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 0.6rem;
  background: var(--blue);
  color: #fff;
  width: 100%;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 16px rgba(49, 70, 98, 0.2);
}
.music-btn:hover {
  background: var(--yellow);
  color: var(--blue);
  transform: translateY(-1px);
}
.music-btn:active {
  background: var(--red);
  color: #fff;
  transform: translateY(0);
}

.country-card.playing {
  box-shadow: 0 0 0 4px var(--red), 0 0 20px rgba(189, 67, 27, 0.55);
  border-color: var(--red);
  transform: translateY(-2px) scale(1.01);
}

/* =========================================
   GALLERY (HOME COUNTRY GALLERY)
   ========================================= */
#country-gallery {
  padding: 1rem 8% 2rem 8%;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--muted);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0,0,0,0.12);
  border-color: rgba(49, 70, 98, 0.2);
}

.img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f7f3eb;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, filter 0.25s ease;
  cursor: zoom-in;
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: brightness(0.98);
}

.hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.45) 100%);
  color: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.6rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.gallery-item:hover .hover-overlay {
  opacity: 1;
}
.hover-overlay p {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.heart-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
  pointer-events: auto;
  box-shadow: 0 8px 16px rgba(0,0,0,0.18);
}
.gallery-item:hover .heart-btn {
  opacity: 1;
  transform: translateY(-2px);
}
@media (hover: none) {
  .heart-btn { opacity: 1; }
}

/* Placeholder when image missing */
.placeholder-thumb {
  width: 100%;
  height: 200px;
  background: #ddd;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  color: #555;
}

/* =========================================
   FAVORITES PAGE
   ========================================= */
#favorites-section {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 10%;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
}

.favorite-card {
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 12px;
  padding: 0.7rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}
.favorite-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
  border-color: rgba(49, 70, 98, 0.18);
}

.fav-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  cursor: zoom-in;
  background: #f5f2eb;
}

.artist-name {
  font-weight: 700;
  margin: 0.2rem 0 0.1rem 0;
}

.country-name {
  opacity: 0.75;
  margin-bottom: 0.6rem;
}

.remove-btn {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  background: #c62828;
  color: #fff;
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}
.remove-btn:hover {
  background: #9b1f1f;
}
.remove-btn:active {
  transform: translateY(1px);
}

.not-logged-in,
.no-favorites {
  text-align: center;
  padding: 2rem 0;
  color: var(--blue);
  font-weight: 600;
}
/* AUTH PAGES */
.auth-shell {
  max-width: 1020px;
  margin: 1.4rem auto 2.2rem auto;
  padding: 0 10%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - var(--header-height) - 160px);
}

.auth-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 18px;
  padding: 1.8rem 1.8rem;
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.auth-card h2 {
  margin: 0 0 0.6rem 0;
  font-size: 1.35rem;
  color: var(--blue);
}

.auth-msg {
  margin: 0 0 0.9rem 0;
  color: var(--red);
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-form label {
  font-weight: 600;
  color: var(--blue);
  font-size: 0.95rem;
}

.auth-form input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--muted);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 70, 98, 0.12);
}

.auth-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.auth-help {
  font-size: 0.9rem;
  color: var(--blue);
  opacity: 0.85;
}
.auth-help a { color: var(--red); }


/* =========================================
   CONTACT PAGE
   ========================================= */
#contact-page {
  max-width: 1100px;
  margin: 1.8rem auto 2.6rem auto;
  padding: 0 10%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - var(--header-height) - 160px);
}

.contact-box {
  width: min(880px, 100%);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
  padding: 1.8rem 2rem;
  text-align: center;
}

.contact-lede {
  margin: 0.4rem 0 1.2rem 0;
  font-size: 1.02rem;
  line-height: 1.65;
  opacity: 0.92;
}

.contact-lines {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
}

.contact-lines p {
  margin: 0;
  font-size: 1.02rem;
}

.contact-label {
  font-weight: 700;
  color: var(--blue);
  margin-right: 0.35rem;
}

.contact-lines a {
  color: var(--red);
  font-weight: 700;
}
.contact-lines a:hover {
  color: var(--blue);
}

.contact-note {
  margin-top: 1.2rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(49, 70, 98, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

@media (max-width: 768px) {
  .contact-box {
    padding: 1.35rem 1.2rem;
  }
}

/* =========================================
   AUTH PAGES (LOGIN / REGISTER)
   ========================================= */
.auth-shell {
  max-width: 1100px;
  margin: 1.8rem auto 2.6rem auto;
  padding: 0 10%;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
  padding: 1.8rem 2rem;
}

.auth-card h2 {
  margin: 0 0 0.75rem 0;
  text-align: center;
  color: var(--blue);
}

.auth-msg {
  background: rgba(189, 67, 27, 0.1);
  color: var(--red);
  border: 1px solid rgba(189, 67, 27, 0.25);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 0.8rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--blue);
}

.auth-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--muted);
  border-radius: 10px;
  background: #fffdf9;
  font-size: 0.96rem;
}

.auth-form input:focus {
  outline: 2px solid rgba(189, 67, 27, 0.2);
}

.auth-form .primary-btn {
  width: 100%;
  text-align: center;
}

/* =========================================
   ABOUT PAGE
   ========================================= */
#about-page {
  max-width: 1000px;
  margin: 1.2rem auto 2rem auto;
  padding: 1.4rem 7%;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

#about-page p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 1.05rem 0;
  opacity: 0.94;
}

.about-logo-inline {
  width: 150px;
  float: right;
  margin: 0 0 1rem 1.4rem;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.about-video-wrapper {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.about-video-wrapper video {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--muted);
}

/* =========================================
   IMAGE LIGHTBOX
   ========================================= */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1500;
}
.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-content {
  position: relative;
  width: min(1100px, 92vw);
  display: flex;
  justify-content: center;
}
.lightbox-image {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 18px;
  background: #0f1115;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}
.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background 0.2s ease;
}
.lightbox-close:hover {
  background: rgba(189, 67, 27, 0.9);
  transform: translateY(-1px);
}
.lightbox-close:active {
  transform: translateY(0);
}
body.lightbox-open {
  overflow: hidden;
}

/* =========================================
   DIY CANVAS
   ========================================= */
#diy-hero {
  text-align: center;
  padding: 1rem 10%;
}
.diy-lede {
  max-width: 720px;
  margin: 0.4rem auto 1.1rem auto;
}

#diy-tools {
  max-width: 900px;
  margin: 0 auto 1.8rem auto;
  padding: 0 10%;
}

#diy-tools .controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

#color-picker {
  width: 52px;
  height: 52px;
  border: 1px solid var(--muted);
  border-radius: 12px;
  padding: 0;
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.canvas-shell {
  border: 1px dashed rgba(49, 70, 98, 0.35);
  border-radius: 14px;
  overflow: hidden;
  background: #faf6ef;
  padding: 0.6rem;
  box-shadow: inset 0 0 0 1px rgba(49,70,98,0.05), var(--shadow);
}

#doodle-canvas {
  display: none;
  width: 100%;
  height: auto;
  min-height: 320px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(49, 70, 98, 0.08);
}

/* =========================================
   FOOTER
   ========================================= */
footer {
  text-align: center;
  padding: 0.65rem;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--blue);
  border-top: none;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  #country-gallery {
    padding: 0.8rem 6% 1.5rem 6%;
  }
  .slider-window {
    width: 88%;
  }
  #main-header {
    border-radius: 0 0 14px 14px;
  }
}

@media (max-width: 768px) {
  #main-header {
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
  }
  #main-index ul {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  #hero-section,
  #learn-intro,
  #diy-hero,
  #diy-tools {
    padding-left: 6%;
    padding-right: 6%;
  }
  #contact-page {
    padding-left: 6%;
    padding-right: 6%;
  }
  #about-page {
    padding-left: 5.5%;
    padding-right: 5.5%;
  }
  .about-logo-inline {
    float: none;
    display: block;
    margin: 0 auto 1rem auto;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .favorites-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 520px) {
  .slider-window {
    width: 84%;
  }
  .country-item {
    margin: 0 0.35rem;
    font-size: 0.88rem;
    padding: 0.15rem 0.45rem;
  }
  .slider-arrow {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }
  .music-btn {
    font-size: 0.85rem;
  }
  .canvas-shell {
    padding: 0.45rem;
  }
  .lightbox-content {
    width: 96vw;
  }
  .lightbox-close {
    width: 34px;
    height: 34px;
    top: -10px;
    right: -10px;
  }
}
