@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
  /* Harmonious Dark Mode HSL Palette */
  --bg-primary: hsl(220, 24%, 6%);
  --bg-secondary: hsl(220, 20%, 10%);
  --bg-tertiary: hsl(220, 18%, 14%);
  --border-color: hsla(220, 15%, 25%, 0.4);
  --border-focus: hsl(28, 100%, 53%);
  
  /* Brand colors: Neon Amber Warning Tag theme */
  --accent-primary: hsl(28, 100%, 50%);
  --accent-hover: hsl(28, 100%, 43%);
  --accent-glow: hsla(28, 100%, 50%, 0.15);
  --accent-glow-strong: hsla(28, 100%, 50%, 0.4);
  
  /* Text colors */
  --text-primary: hsl(220, 14%, 96%);
  --text-secondary: hsl(220, 12%, 76%);
  --text-muted: hsl(220, 10%, 55%);
  --text-inverse: hsl(220, 24%, 6%);
  
  /* Feedback states */
  --color-error: hsl(354, 84%, 57%);
  --color-error-bg: hsla(354, 84%, 57%, 0.1);
  --color-success: hsl(142, 69%, 45%);
  --color-success-bg: hsla(142, 69%, 45%, 0.1);
  
  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Layout */
  --max-width: 680px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Base reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: -webkit-fill-available;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, hsla(28, 100%, 50%, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, hsla(220, 100%, 50%, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
}

/* Focus styling */
:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
}

/* Typography elements */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: 2.75rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

p {
  color: var(--text-secondary);
  font-weight: 400;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Header styling */
header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

/* Glowing tag badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--accent-glow);
  border: 1px solid var(--accent-glow-strong);
  color: var(--accent-primary);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  animation: pulse-border 2.5s infinite alternate;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: pulse-dot-scale 1.5s infinite ease-in-out;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0.75rem auto 0;
}

.tagline strong {
  color: var(--text-primary);
}

/* The Hall of Lost Things - Interactive Grid */
.hall-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hall-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.item-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.item-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 50%, var(--accent-glow) 100%);
  opacity: 0;
  transition: var(--transition-smooth);
}

.item-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent-glow-strong);
  box-shadow: 0 8px 24px rgba(255, 122, 0, 0.08);
}

.item-card:hover::after {
  opacity: 1;
}

.item-card.selected {
  border-color: var(--accent-primary);
  background: hsla(28, 100%, 50%, 0.03);
  box-shadow: 0 0 16px var(--accent-glow);
}

.item-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.item-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Radio buttons container inside cards (visually hidden) */
.item-card input[type="radio"] {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* Form Styling */
.form-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.form-title {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-group {
  position: relative;
  margin-bottom: 1.75rem;
}

/* Floating labels effect */
.form-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem 0.5rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  min-height: 56px;
  transition: var(--transition-smooth);
}

.form-input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 8px var(--accent-glow);
}

.form-label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  pointer-events: none;
  transform-origin: 0 0;
}

/* Float logic */
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  transform: translateY(-0.5rem) scale(0.75);
  color: var(--accent-primary);
}

textarea.form-input {
  min-height: 120px;
  padding-top: 1.5rem;
  resize: vertical;
}

/* Honeypot field - must be hidden securely */
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* Input helper messages */
.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: block;
}

.form-error {
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: 0.35rem;
  display: none;
  align-items: center;
  gap: 0.35rem;
}

/* Invalid inputs styling */
.form-input:invalid:user-invalid {
  border-color: var(--color-error);
}

/* Form Grid for side-by-side elements */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Submit Button */
.submit-btn {
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 2rem;
  width: 100%;
  cursor: pointer;
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px var(--accent-glow-strong);
  position: relative;
  overflow: hidden;
}

.submit-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow-strong);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Spinner indicator */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--text-inverse);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
  display: none;
}

.submit-btn.loading .btn-spinner {
  display: inline-block;
}

.submit-btn.loading .btn-text {
  opacity: 0.7;
}

/* Form success overlay / view transition states */
.form-state-container {
  position: relative;
  min-height: 400px;
  overflow: hidden;
}

.state-panel {
  transition: var(--transition-smooth);
}

.state-panel.hidden {
  display: none;
  opacity: 0;
  transform: scale(0.95);
}

.state-success {
  text-align: center;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.success-icon-wrapper {
  width: 80px;
  height: 80px;
  background-color: var(--color-success-bg);
  border: 2px solid var(--color-success);
  color: var(--color-success);
  font-size: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  animation: pop-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-title {
  color: var(--color-success);
  margin-bottom: 0.75rem;
}

.success-subtitle {
  max-width: 400px;
  margin-bottom: 2rem;
}

/* Status message banners */
.form-alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: none;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 500;
  animation: slide-down 0.4s ease;
}

.form-alert.alert-error {
  display: flex;
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  color: var(--color-error);
}

.form-alert.alert-success {
  display: flex;
  background: var(--color-success-bg);
  border: 1px solid var(--color-success);
  color: var(--color-success);
}

/* FAQ / Info Accordion */
.faq-section {
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.faq-title {
  text-align: center;
  margin-bottom: 1.5rem;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-header {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 1.25rem 1.5rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: var(--transition-smooth);
}

.faq-header:hover {
  background: var(--bg-tertiary);
}

.faq-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: var(--accent-primary);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  background: var(--bg-tertiary);
  padding: 0 1.5rem;
}

.faq-item.active .faq-content {
  max-height: 500px;
  padding: 0.5rem 1.5rem 1.5rem;
  transition: max-height 0.4s cubic-bezier(0.5, 1, 0.89, 1);
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
}

footer p {
  color: var(--text-muted);
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-border {
  from { border-color: hsla(28, 100%, 50%, 0.2); box-shadow: 0 0 4px hsla(28, 100%, 50%, 0.1); }
  to { border-color: hsla(28, 100%, 50%, 0.7); box-shadow: 0 0 16px hsla(28, 100%, 50%, 0.3); }
}

@keyframes pulse-dot-scale {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

@keyframes pop-in {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slide-down {
  0% { transform: translateY(-10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Responsive constraints */
@media (max-width: 580px) {
  h1 {
    font-size: 2.2rem;
  }
  
  .container {
    padding: 1.5rem 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .hall-grid {
    grid-template-columns: 1fr;
  }
  
  .form-section {
    padding: 1.5rem 1.25rem;
  }
  
  .item-card {
    padding: 1rem;
  }
}
