/* ============================================================
   Emma & Sandro — Marstrand 2027
   Gemensam stilmall för index.html och anmalan.html
   ============================================================ */

:root {
  --cream:        #f6efe4;
  --cream-soft:   rgba(246, 239, 228, 0.78);
  --cream-faint:  rgba(246, 239, 228, 0.55);
  --gold:         #d8b074;
  --gold-deep:    #b98f4e;
  --teal:         #2f8f9d;
  --teal-deep:    #257885;
  --ink:          #0c0f12;
  --line:         rgba(246, 239, 228, 0.35);

  --font-script: 'Great Vibes', cursive;
  --font-amp:    'Pinyon Script', cursive;
  --font-sans:   'Jost', sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--cream);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---- Bakgrund: Marstrandsbild + mörk gradient för läsbarhet ---- */
.bg {
  position: fixed;
  inset: 0;
  background: url('bakgrund.jpg') center 38% / cover no-repeat;
  z-index: -2;
}
.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(8, 11, 14, 0.92) 0%,
      rgba(8, 11, 14, 0.78) 30%,
      rgba(8, 11, 14, 0.42) 60%,
      rgba(8, 11, 14, 0.30) 100%),
    linear-gradient(180deg,
      rgba(8, 11, 14, 0.35) 0%,
      rgba(8, 11, 14, 0.05) 40%,
      rgba(8, 11, 14, 0.55) 100%);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: 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='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   STARTSIDA
   ============================================================ */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  padding: clamp(2rem, 6vw, 7rem);
}

/* ---- Vänster: innehåll ---- */
.content { max-width: 560px; }

.content .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: rise 0.9s ease 0.1s forwards;
}

.names {
  font-family: var(--font-script);
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  font-weight: 400;
  line-height: 0.95;
  color: var(--cream);
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
  opacity: 0;
  animation: rise 1s ease 0.25s forwards;
}
.names .amp { font-family: var(--font-amp); color: var(--gold); font-size: 0.92em; }

.meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.6rem 0 2.4rem;
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream-soft);
  opacity: 0;
  animation: rise 1s ease 0.4s forwards;
}
.meta::before {
  content: '';
  width: 46px;
  height: 1px;
  background: var(--gold);
  flex: none;
}

.tagline {
  font-family: var(--font-script);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  color: var(--cream);
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: rise 1s ease 0.55s forwards;
}

.lead {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--cream-soft);
  font-weight: 300;
  max-width: 460px;
  margin-bottom: 2.4rem;
  border-left: 2px solid var(--line);
  padding-left: 1.4rem;
  opacity: 0;
  animation: rise 1s ease 0.7s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--teal);
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 1.15rem 2.4rem;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  opacity: 0;
  animation: rise 1s ease 0.85s forwards;
}
.btn:hover {
  background: var(--teal-deep);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(0,0,0,0.45);
}
.btn .arrow { transition: transform 0.3s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Höger: nedräkning ---- */
.countdown {
  flex: none;
  opacity: 0;
  animation: fadeIn 1.2s ease 0.5s forwards;
}

.count-box {
  position: relative;
  border: 1px solid var(--line);
  padding: clamp(3rem, 5vw, 4.5rem) clamp(3.5rem, 6vw, 5.5rem);
  text-align: center;
  backdrop-filter: blur(2px);
  background: rgba(8, 11, 14, 0.12);
}
.count-box::before,
.count-box::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid var(--gold);
}
.count-box::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.count-box::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.count-days {
  font-size: clamp(8rem, 16vw, 14rem);
  font-weight: 200;
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--cream);
}
.count-days-label {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-weight: 300;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--cream-soft);
  margin-top: 1.1rem;
  padding-left: 0.5em;
}

/* ============================================================
   ANMÄLNINGSSIDA
   ============================================================ */
.form-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.card {
  width: 100%;
  max-width: 480px;
  background: rgba(8, 11, 14, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  padding: clamp(2.2rem, 5vw, 3.4rem);
  position: relative;
  opacity: 0;
  animation: rise 0.9s ease 0.1s forwards;
}
.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid var(--gold);
}
.card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.card .eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.card h1 {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1;
  margin-bottom: 0.6rem;
}
.card h1 .amp { color: var(--gold); }
.card .sub {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--cream-soft);
  margin-bottom: 2rem;
}

.field { margin-bottom: 1.3rem; }
.field label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-faint);
  margin-bottom: 0.5rem;
}
.field input {
  width: 100%;
  background: rgba(246, 239, 228, 0.06);
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 300;
  padding: 0.85rem 1rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.field input::placeholder { color: rgba(246, 239, 228, 0.35); }
.field input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(246, 239, 228, 0.1);
}

.btn-full { width: 100%; justify-content: center; margin-top: 0.6rem; animation: none; opacity: 1; }

.form-note {
  font-size: 0.78rem;
  color: var(--cream-faint);
  font-weight: 300;
  margin-top: 1.4rem;
  text-align: center;
  line-height: 1.6;
}

.back-link {
  display: inline-block;
  margin-top: 1.6rem;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.back-link:hover { color: var(--gold); border-color: var(--gold); }

/* Statusmeddelanden */
.status { font-size: 0.92rem; font-weight: 300; line-height: 1.7; margin-top: 1.2rem; text-align: center; }
.status.ok  { color: var(--gold); }
.status.err { color: #e6a08a; }

.success-panel { text-align: center; }
.success-panel .check {
  width: 64px; height: 64px; margin: 0 auto 1.4rem;
  border: 1px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 1.8rem;
}
.success-panel h2 {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 0.8rem;
}
.success-panel p { color: var(--cream-soft); font-weight: 300; line-height: 1.7; }

/* ---- Animationer ---- */
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   RESPONSIVT
   ============================================================ */
@media (max-width: 860px) {
  .stage {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 3rem;
    padding: 3rem 1.6rem;
  }
  .content { max-width: 100%; }
  .meta { justify-content: center; }
  .meta::before { display: none; }
  .lead {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 1.4rem;
    margin-left: auto;
    margin-right: auto;
  }
  .bg::after {
    background:
      linear-gradient(180deg,
        rgba(8, 11, 14, 0.85) 0%,
        rgba(8, 11, 14, 0.6) 50%,
        rgba(8, 11, 14, 0.85) 100%);
  }
}
