/* =========================
1. Reset og grundlæggende
========================= */
html {
  /* Tillader scrolling, når indholdet er længere end skærmen */
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: #0b1f33;
  /* Central Radial Gradient dækker 100% af elementet */
  background-image: radial-gradient(circle at center, #142f50 0%, #0b1f33 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: "Open Sans", sans-serif;
  background-color: #000105; /* Fallback for p5/partikel lag */
  color: white;
  overflow-y: auto; /* Tillader lodret scroll */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* =========================
2. Partikler & Gradienter (Pseudo-elementer)
========================= */

/* LAG 1: SMÅ/SVAGERE - OPACITET 0.3 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  opacity: 0.3;
  background-image: radial-gradient(
      circle at 10% 10%,
      rgba(100, 150, 200, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(150, 100, 200, 0.3) 0%,
      transparent 50%
    );
  background-position: 10% 5%, 90% 15%, 20% 80%, 85% 40%, 45% 75%, 0 0, 0 0;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  z-index: -1;
  pointer-events: none; /* Løser mobil scroll ved at lade touch passere igennem */
}

/* LAG 2: STØRRE/LYSERE - OPACITET 0.6 */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  opacity: 0.6;
  background-image: radial-gradient(
      circle at 10% 10%,
      rgba(100, 150, 200, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(150, 100, 200, 0.3) 0%,
      transparent 50%
    );
  background-position: 75% 85%, 30% 15%, 15% 50%, 0 0, 0 0;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  z-index: -1;
  pointer-events: none;
}

#p5-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* =========================
3. Hovedindhold & Layout (Centrering)
========================= */
main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  justify-content: center; /* Centrerer vandret */
  align-items: center; /* Centrerer lodret */
  min-height: 100vh;
  padding: 40px 0;
  box-sizing: border-box;
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center; /* Sikrer, at wrapperens indhold er centreret */
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
  box-sizing: border-box;
}

.login-signup-container.top-container h2,
.login-signup-container h2 {
  font-size: 2rem;
  margin-bottom: 5px;
  line-height: 1.2;
}

/* Specifikke tilstande for container */
.login-signup-container.error-only {
  justify-content: flex-start;
  gap: 6px;
  padding: 25px 20px;
  min-height: auto;
}

.login-signup-container.form-mode {
  justify-content: space-between;
  min-height: 450px;
}

.login-signup-container.full-height {
  min-height: auto;
  padding: 30px 20px;
}

/* =========================
5. Form Elementer
========================= */
.logo-header {
  margin-bottom: 5px;
  text-align: center;
}

.logo-header a {
  display: block;
  text-decoration: none;
}

.logo-header img {
  max-width: 100px;
  height: auto;
}

.email-login {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 10px;
}

.email-login input[type="email"],
.email-login input[type="password"],
.email-login input[type="text"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background-color: #2a3748;
  color: #fff;
  font-size: 1.1rem;
  box-sizing: border-box;
}

input::placeholder {
  color: #aaa;
}

/* =========================
6. Knapper (Samlet Stil)
========================= */
.discord-btn,
.email-login button,
.create-account-btn,
.confirm-btn-style,
.discord-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 8px;
  border: 2px solid transparent; /* Plads til border uden at ændre højden */
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Discord Specifik */
.discord-btn,
.discord-button {
  background-color: #5865f2 !important;
  color: #ffffff !important;
  border: none;
}

.discord-btn:hover,
.discord-button:hover {
  background-color: #757dda !important;
}

.discord-btn img {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  flex-shrink: 0;
}

/* Email Login Knap */
.email-login button {
  background-color: #2f855a;
  color: #fff;
  font-size: 1.2rem;
}

.email-login button:hover {
  background-color: #276644;
}

/* Create Account Knap */
.create-account-btn {
  background-color: #6a00ff;
  border: 2px solid #6a00ff;
  color: #fff;
}

.create-account-btn:hover {
  background-color: #4e00b3;
  border-color: #4e00b3;
}

/* Bekræft / Succes Stil */
.confirm-btn-style {
  background: #00ff6a;
  color: #0d1b2a;
  font-weight: 800;
}

/* =========================
7. UI Hjælpere (Skillevægge, Tekst, Fejl)
========================= */
.divider {
  display: flex;
  align-items: center;
  margin: 15px 0;
  color: #aaa;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #555;
}

.divider::before {
  margin-right: 2em;
}
.divider::after {
  margin-left: 2em;
}

.error-text,
.error-msg {
  color: #ff4d4d;
  font-weight: 600;
  font-size: 1rem;
}

.error-msg {
  font-size: 1.05rem;
  margin: 0;
}

.success-text {
  color: #4caf50;
  font-size: 1rem;
}

.error-text,
.success-text {
  margin-bottom: 14px;
}

.create-account-wrapper {
  text-align: center;
  border-top: 1px solid #334358;
  padding-top: 20px;
  margin-top: 10px;
}

.signup-prompt {
  color: #fff;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.forgot,
.login-link {
  margin-top: 20px;
  font-size: 0.95rem;
}

.forgot a,
.login-link a {
  color: #7289da;
  text-decoration: underline;
}

/* =========================
8. Mobilspecifikke justeringer (< 700px)
========================= */
@media (max-width: 700px) {
  html,
  body {
    background-color: #1f2a38 !important; /* Matcher container farve */
    background-image: none !important;
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden;
  }

  body::before,
  body::after {
    display: none !important;
  }

  main {
    display: block !important;
    min-height: auto !important;
    height: auto !important;
    padding: 0 !important;
    background-color: #1f2a38 !important;
  }

  .wrapper {
    padding: 0 !important;
    max-width: 100%;
  }

  .login-signup-container {
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: 100vh; /* Fylder skærmen men vokser med indholdet */
    margin: 0 !important;
    padding: 40px 25px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background-color: #1f2a38 !important;
    justify-content: flex-start;
  }

  .logo-header img {
    max-width: 80px;
  }

  .login-signup-container h2 {
    font-size: 1.8rem;
  }

  .email-login input,
  .email-login button {
    font-size: 1rem;
    padding: 10px;
  }

  .login-link {
    margin-bottom: 0 !important;
    padding-bottom: 10px !important;
  }
}

/* =========================
1. Reset og grundlæggende
========================= */
html {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: #0b1f33;
  background-image: radial-gradient(circle at center, #142f50 0%, #0b1f33 100%);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: "Open Sans", sans-serif;
  background-color: #000105;
  color: white;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* =========================
2. Partikler & Gradienter
========================= */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  mix-blend-mode: screen;
  z-index: -1;
  pointer-events: none;
}

body::before {
  opacity: 0.3;
  background-image: radial-gradient(
      circle at 10% 10%,
      rgba(100, 150, 200, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(150, 100, 200, 0.3) 0%,
      transparent 50%
    );
  background-position: 10% 5%, 90% 15%, 20% 80%, 85% 40%, 45% 75%, 0 0, 0 0;
  background-repeat: no-repeat;
}

body::after {
  opacity: 0.6;
  background-image: radial-gradient(
      circle at 10% 10%,
      rgba(100, 150, 200, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(150, 100, 200, 0.3) 0%,
      transparent 50%
    );
  background-position: 75% 85%, 30% 15%, 15% 50%, 0 0, 0 0;
  background-repeat: no-repeat;
}

#p5-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* =========================
3. Hovedindhold & Layout (RETTET: NU MED TVUNGEN CENTRERING)
========================= */
main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  justify-content: center; /* Centrerer vandret */
  align-items: center; /* Centrerer lodret */
  text-align: center;
  min-height: 100vh;
  width: 100%; /* Sikrer at main bruger hele bredden */
  padding: 40px 0;
  box-sizing: border-box;
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center; /* Centrerer indholdet i wrapperen */
  justify-content: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto; /* Centrerer selve wrapperen horisontalt */
  padding: 0 20px;
  box-sizing: border-box;
}

/* =========================
4. Container & Kort Styling (RETTET: MARGIN AUTO TILFØJET)
========================= */
.login-signup-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto; /* TVINGER containeren til midten */
  padding: 45px 35px;
  background-color: #1f2a38;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.2s ease-in-out;
  z-index: 10;
  box-sizing: border-box;
  text-align: center;
}

/* =========================
5. Form Elementer, Logo og Knapper
========================= */
.logo-header {
  margin-bottom: 5px;
  display: flex;
  justify-content: center;
}

.logo-header img {
  max-width: 100px;
  height: auto;
}

.email-login {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 10px;
}

.email-login input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background-color: #2a3748;
  color: #fff;
  font-size: 1.1rem;
  box-sizing: border-box;
}

.discord-btn,
.email-login button,
.create-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.discord-btn {
  background-color: #5865f2 !important;
  color: white !important;
}
.email-login button {
  background-color: #2f855a;
  color: white;
}
.create-account-btn {
  background-color: #6a00ff;
  color: white;
}

.divider {
  display: flex;
  align-items: center;
  margin: 15px 0;
  color: #aaa;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #555;
}
.divider::before {
  margin-right: 2em;
}
.divider::after {
  margin-left: 2em;
}

.login-link a {
  color: #7289da;
  text-decoration: underline;
}

/* =========================
6. Mobilspecifikke justeringer (< 700px)
========================= */
@media (max-width: 700px) {
  html,
  body {
    background-color: #1f2a38 !important;
    background-image: none !important;
  }
  body::before,
  body::after {
    display: none !important;
  }
  main {
    display: block !important;
    min-height: auto !important;
    padding: 0 !important;
  }
  .wrapper {
    padding: 0 !important;
  }
  .login-signup-container {
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100vh;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
  }
}

:root {
  --primary: #00ff6a;
  --card-bg: #1f2a38;
  --border: rgba(255, 255, 255, 0.1);
  --blue: #60a5fa;
  --star-active: #eab308;
  --star-dim: #374151;
  --bg-dark: #0b1f33;
  --bg-light: #142f50;
}

html {
  min-height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  background-image: radial-gradient(
    circle at center,
    var(--bg-light) 0%,
    var(--bg-dark) 100%
  );
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: "Open Sans", sans-serif;
  background: transparent;
  display: flex;
  flex-direction: column;
  color: white;
  position: relative;
  z-index: 1;
}

/* Partikel-lag 1 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.3;
  background-image: radial-gradient(
      circle at 10% 10%,
      rgba(100, 150, 200, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(150, 100, 200, 0.3) 0%,
      transparent 50%
    );
  background-position: 10% 5%, 90% 15%, 20% 80%, 85% 40%, 45% 75%, 0 0, 0 0;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  z-index: -1;
  pointer-events: none;
}

/* Partikel-lag 2 */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.6;
  background-image: radial-gradient(
      circle at 10% 10%,
      rgba(100, 150, 200, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(150, 100, 200, 0.3) 0%,
      transparent 50%
    );
  background-position: 75% 85%, 30% 15%, 15% 50%, 0 0, 0 0;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  z-index: -1;
  pointer-events: none;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  z-index: 10;
}

.card {
  max-width: 600px;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 45px 35px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.intro-text {
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.6;
  margin-bottom: 35px;
  text-align: left;
  border-left: 3px solid var(--blue);
  padding-left: 15px;
  font-style: italic;
}

.goal-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  text-align: left;
}

.rating-scale {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 15px;
}

.rating-scale label {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 0;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  transition: 0.2s;
}

.rating-scale input:checked + label {
  background: var(--blue);
  color: #0d1b2a;
  font-weight: bold;
}

.rating-scale input {
  display: none;
}

.mood-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 30px 0;
}

.mood-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.mood-item {
  cursor: pointer;
  opacity: 0.3;
  transition: 0.3s;
}

.mood-item input {
  display: none;
}

.mood-item span {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 5px;
}

.mood-item:has(input:checked) {
  opacity: 1;
  transform: scale(1.05);
}

.star-section {
  margin: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.star-rating-wrapper {
  display: flex;
  flex-direction: row-reverse;
  gap: 12px;
  position: relative;
}

.star-rating-wrapper input {
  display: none;
}

.star-label {
  font-size: 2.5rem;
  color: var(--star-dim);
  cursor: pointer;
  transition: 0.2s;
}

.star-label:hover,
.star-label:hover ~ .star-label {
  color: var(--star-active);
}

.star-rating-wrapper input:checked ~ .star-label {
  color: var(--star-active);
}

.zero-zone {
  position: absolute;
  left: -40px;
  width: 40px;
  height: 100%;
  cursor: pointer;
  z-index: 10;
}

.rating-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: #9ca3af;
  margin-top: 5px;
}

textarea {
  width: 100%;
  min-height: 130px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: white;
  padding: 15px;
  resize: none;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
  transition: border-color 0.3s;
}

textarea:focus {
  border-color: var(--blue);
}

.submit-btn {
  width: 100%;
  padding: 20px;
  background: var(--primary);
  color: #0d1b2a;
  border: none;
  border-radius: 15px;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 40px;
  transition: 0.3s;
}

@media (max-width: 700px) {
  html,
  body {
    background-color: var(--card-bg) !important;
    background-image: none !important;
  }

  body::before,
  body::after {
    display: none !important;
  }

  main {
    display: block !important;
    padding: 0 !important;
  }

  .card {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 100vh;
    padding: 40px 25px !important;
  }
}
