:root {
  --color-bg: #f4f6f5;
  --color-surface: #ffffff;
  --color-primary: #1a5f4a;
  --color-primary-dark: #12483a;
  --color-primary-light: #e4f2ec;
  --color-text: #1c2622;
  --color-text-muted: #64726c;
  --color-border: #dfe6e2;
  --color-error: #c62828;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 30, 25, 0.08), 0 1px 2px rgba(20, 30, 25, 0.06);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-primary);
  color: #fff;
  padding: max(14px, env(safe-area-inset-top)) 16px 14px;
  box-shadow: var(--shadow);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
}

.topbar__logo {
  font-size: 22px;
}

.topbar__title {
  font-size: 17px;
  font-weight: 600;
}

.screen {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px calc(32px + env(safe-area-inset-bottom));
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 6px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.card__hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 14px;
}

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-group--pair {
  flex-direction: row;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice-btn--compact {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 16px 8px;
}

.choice-btn__icon {
  font-size: 22px;
  line-height: 1;
}

.choice-btn.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.field-error {
  display: none;
  color: var(--color-error);
  font-size: 13px;
  margin: 8px 0 0;
}

.field-error.is-visible {
  display: block;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.field__optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

.field__input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
}

.field__input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.field__input--textarea {
  resize: vertical;
  min-height: 72px;
}

.form-error {
  color: var(--color-error);
  font-size: 14px;
  text-align: center;
  margin: 0 0 12px;
  font-weight: 500;
}

.submit-btn {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.submit-btn:active {
  background: var(--color-primary-dark);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 40px;
}

.success__icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.success .submit-btn {
  max-width: 320px;
  margin-top: 12px;
}

@media (min-width: 480px) {
  .screen {
    padding-top: 32px;
  }
}
