:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2d2d2d;
  --text: #f0f0f0;
  --text-muted: #9a9a9a;
  --accent: #c9a227;
  --accent-hover: #dbb42e;
  --accent-soft: rgba(201, 162, 39, 0.15);
  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: "Poppins", system-ui, sans-serif;
  --font-display: "Poppins", system-ui, sans-serif;
  --space: 1.25rem;
  --max-width: 42rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 5vw, 2rem);
  max-width: calc(var(--max-width) + 4rem);
  margin: 0 auto;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.header-logo {
  display: block;
  margin: 0 auto 1rem;
  height: clamp(2.5rem, 8vw, 3.5rem);
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.session-bar {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: flex-start;
  justify-content: center;
}

.session-display {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.session-display strong {
  color: var(--accent);
}

.session-retrieve {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
  max-width: 20rem;
}

.session-retrieve-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.session-retrieve-row {
  display: flex;
  gap: 0.5rem;
}

.session-retrieve-row input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}

.btn-retrieve {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.session-message {
  font-size: 0.85rem;
  min-height: 1.3em;
}

.session-message.success { color: #7cb87c; }
.session-message.error { color: #d66; }

.autosave-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.3em;
}

.autosave-status.saved { color: #7cb87c; }
.autosave-status.error { color: #d66; }

/* Sections */
.section {
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--accent);
}

.section-hint {
  margin: -0.5rem 0 1rem;
}

/* Form fields */
.field {
  margin-bottom: var(--space);
}

.field[data-depends] {
  display: none;
}

.field[data-depends][data-visible="true"] {
  display: block;
}

.label,
.field label {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.label {
  margin-bottom: 0.6rem;
}

.required {
  color: var(--accent);
}

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.5rem;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239a9a9a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

textarea {
  resize: vertical;
  min-height: 4.5em;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.9;
}

/* Checkbox group */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem 1.25rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
  font-size: 0.95rem;
}

.checkbox-label input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 380px) {
  .checkbox-group {
    grid-template-columns: 1fr;
  }
}

/* Submit */
.section-contact {
  padding-top: 0.5rem;
}

.form-actions {
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.9rem 1.75rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.form-message {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.form-message.success {
  color: #7cb87c;
}

.form-message.error {
  color: #d66;
}

/* Responsive tweaks */
@media (min-width: 640px) {
  .field {
    margin-bottom: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
