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

:root {
  --bg-color: #F1DABF;
  --text-color: #362417;
  --footer-bg: #FFFBFF;
  --accent-color: #92817A;
  --success-color: #71b65d;
  --error-color: #c86060;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #362417;
    --text-color: #F1DABF;
    --footer-bg: #000500;
    --success-color: #528f40;
    --error-color: #ad3c3c;
  }
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('/.proxy/assets/fonts/SpaceGrotesk-VariableFont_wght-BF65712b500c2f2.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  line-height: 1.5;
}

.main-container {
  max-width: 1100px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}

.content-section,
.graphic-section {
  flex: 0 1 750px;
}

.graphic-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

.error-header {
  display: flex;
  align-items: flex-end;
  margin-bottom: 5rem;
}

.error-code {
  font-size: 5.5rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 0.9;
}

.error-message {
  margin-bottom: 5rem;
}

.error-message h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.error-message p {
  margin-bottom: 0.75rem;
}

/* Dropdown */
.dropdown {
  margin: 5rem 0;
}

.dropdown-summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  background-color: var(--footer-bg);
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.dropdown-summary:hover {
  background-color: var(--accent-color);
  color: var(--footer-bg);
}

.dropdown-summary::after {
  content: "▼";
  font-size: 0.7rem;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.dropdown[open] .dropdown-summary::after {
  transform: rotate(180deg);
}

.dropdown-content {
  padding: 1rem;
  background-color: var(--footer-bg);
  border-radius: 0 0 6px 6px;
  margin-top: 2px;
}

.dropdown-content p {
  margin-bottom: 1rem;
}

.instructions-list {
  padding-left: 1.5rem;
}

.instructions-list li {
  margin-bottom: 0.5rem;
}

/* Progress Captcha */
.progress-captcha {
  background-color: var(--footer-bg);
  padding: 1rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.progress-captcha:hover {
  box-shadow: 0 0 20px var(--accent-color);
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--success-color);
  transition: width 0.3s ease;
  z-index: 1;
}

.progress-captcha.error .progress-bar {
  background: var(--error-color);
}

.captcha-text {
  font-size: 1.3rem;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 0.1rem;
  position: relative;
  z-index: 2;
}

.captcha-subtext {
  font-size: 0.85rem;
  opacity: 0.68;
  position: relative;
  z-index: 2;
}

.info-footer {
  font-size: 0.85rem;
  color: var(--accent-color);
}

.info-footer hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-color), transparent);
  opacity: 0.4;
  margin: 0.75rem 0;
}

.service-status {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.led.up {
  background-color: var(--success-color);
  box-shadow:
      0 0 6px var(--success-color),
      0 0 10px rgba(16, 185, 129, 0.3);
}

.led.down {
  background-color: var(--error-color);
  box-shadow:
      0 0 6px var(--error-color),
      0 0 10px rgba(239, 68, 68, 0.3);
}

.status-graphic {
  width: 100%;
  height: auto;
  max-height: 400px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
}

.light-graphic { display: block; }
.dark-graphic { display: none; }

@media (prefers-color-scheme: dark) {
  .light-graphic { display: none; }
  .dark-graphic { display: block; }
}

@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
    gap: 2rem;
  }

  .content-section,
  .graphic-section {
    width: 100%;
    flex: 0 1 auto;
  }

  .graphic-section {
    order: -1;
  }

  .error-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .error-code {
    font-size: 4rem;
  }

  .status-graphic {
    max-height: 300px;
  }
  
  .dropdown {
    margin: 3rem 0;
  }
}

@media (max-width: 480px) {
  body {
    padding: 1.5rem;
  }

  .error-code {
    font-size: 3.5rem;
  }

  .status-graphic {
    max-height: 250px;
  }
  
  .dropdown-summary,
  .progress-captcha {
    padding: 0.75rem;
  }
  
  .captcha-text {
    font-size: 1.1rem;
  }
}
