@import url("tokens.css");

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  padding: 24px;
  color: var(--fg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.page-header {
  width: 100%;
  max-width: 500px;
  margin: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
}

.page-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wizard {
  width: 100%;
  max-width: 500px;
  margin: 0;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
  text-align: center;
}

/* Atoms DS — Label, Input, Textarea (@repo/platform) */

.ds-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.ds-field:first-of-type {
  margin-top: 0;
}

.ds-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--fg-primary);
}

.ds-hint {
  font-size: 13px;
  color: var(--fg-secondary);
  margin: 0;
  line-height: 1.5;
}

.ds-field-error {
  font-size: 12px;
  color: var(--error-text);
  margin: 0;
  line-height: 1.4;
}

.ds-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--card-outline);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.25;
  color: var(--fg-primary);
  background: var(--neutral-50);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.ds-input::placeholder {
  color: var(--tertiary);
  font-weight: 400;
}

.ds-input:hover {
  border-color: var(--neutral-200);
}

.ds-input:focus-visible {
  border-color: var(--neutral-200);
  box-shadow: 0 0 0 0.5px var(--neutral-200);
}

.ds-input[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: none;
}

.ds-input[type="date"],
.ds-input.ds-date {
  color-scheme: light;
  position: relative;
  cursor: pointer;
}

.ds-input[type="date"]::-webkit-calendar-picker-indicator,
.ds-input.ds-date::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.ds-textarea {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.5;
  color: var(--fg-primary);
  background: var(--primary-foreground);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ds-textarea::placeholder {
  color: var(--tertiary);
  font-weight: 400;
}

.ds-textarea:hover {
  border-color: var(--neutral-200);
}

.ds-textarea:focus-visible {
  border-color: var(--neutral-200);
  box-shadow: 0 0 0 0.5px var(--neutral-200);
}

.ds-textarea[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: none;
}

.hint {
  font-size: 13px;
  color: var(--fg-secondary);
  margin: 4px 0 12px;
  line-height: 1.5;
  text-align: center;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.choice-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.choice-item:hover {
  background: var(--secondary);
}

.choice-item.selected {
  background: var(--neutral-100);
}

.choice-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--background);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-secondary);
  flex-shrink: 0;
  margin-top: 1px;
}

.choice-item.selected .choice-key {
  background: var(--fg-primary);
  border-color: var(--fg-primary);
  color: #ffffff;
}

.choice-label {
  flex: 1;
  padding-top: 2px;
}

.choice-kbd-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--fg-tertiary);
  text-align: center;
}

.choice-kbd-hint kbd {
  display: inline-block;
  min-width: 1.25em;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-secondary);
  line-height: 1.4;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 560px) {
  .option-grid {
    grid-template-columns: 1fr;
  }
}

.option-card {
  border: 1px solid var(--card-outline);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  background: var(--background);
}

.option-card:hover {
  border-color: var(--primary-200);
  background: var(--primary-0);
}

.option-card.selected {
  border-color: var(--primary-400);
  background: var(--primary-0);
  box-shadow: 0 0 0 1px var(--primary-200);
}

.option-card input {
  margin: 2px 0 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-500);
  flex-shrink: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gallery-card {
  border: 1px solid var(--card-outline);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--card);
}

.gallery-card:hover {
  border-color: var(--primary-200);
}

.gallery-card.selected {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 1px var(--primary-200);
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--fg-tertiary);
  text-align: center;
  padding: 8px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-label {
  font-size: 11px;
  padding: 8px 10px;
  background: var(--input-group);
  border-top: 1px solid var(--border);
  color: var(--fg-primary);
  line-height: 1.3;
}

.view-toggle {
  display: flex;
  width: fit-content;
  gap: 4px;
  margin: 0 auto 12px;
  padding: 4px;
  background: var(--secondary);
  border-radius: var(--radius);
}

.view-btn {
  padding: 6px 14px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.view-btn:hover {
  color: var(--fg-primary);
}

.view-btn.active {
  background: var(--background);
  color: var(--fg-primary);
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.06);
}

.step-buttons {
  display: flex;
  flex-direction: column;
  margin-top: 32px;
  gap: 10px;
}

.step-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.step-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #b8b8b8;
  transition: background 0.2s ease, width 0.2s ease;
  flex-shrink: 0;
}

.step-dot.active {
  width: 21px;
  background: var(--fg-primary);
}

button {
  font-family: inherit;
}

button.btn-next,
button.btn-submit {
  width: 100%;
  background: var(--fg-primary);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s;
  min-height: 44px;
}

button.btn-next:hover,
button.btn-submit:hover {
  background: #262626;
}

button.btn-next:active,
button.btn-submit:active {
  transform: scale(0.98);
}

button.btn-next:disabled,
button.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

button.btn-back {
  width: 100%;
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--fg-primary);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  order: -1;
}

button.btn-back:hover {
  background: var(--muted);
  border-color: #e5e5e5;
}

button.btn-back:active {
  transform: scale(0.97);
}

.btn-notion-link:active {
  transform: scale(0.97);
}

.notion-auth {
  margin-bottom: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-group);
}

.btn-notion {
  margin-top: 12px;
  background: var(--foreground);
  color: var(--background);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
  transition: transform 0.15s ease, opacity 0.15s;
}

.btn-notion:hover {
  opacity: 0.9;
}

.btn-notion:active {
  transform: scale(0.97);
}

.btn-notion-link {
  margin-top: 8px;
  background: none;
  border: none;
  padding: 0;
  color: var(--fg-secondary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notion-user-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.notion-user-email {
  color: var(--fg-secondary);
  font-size: 13px;
}

.oauth-card {
  margin-top: 48px;
  text-align: center;
}

.review-summary {
  background: var(--input-group);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.6;
}

.review-summary b {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-secondary);
}

.review-summary b:first-child {
  margin-top: 0;
}

.submit-status {
  margin-top: 16px;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.submit-status.error {
  color: var(--error-text);
  background: var(--error-bg);
  border-color: var(--error-border);
}

.submit-status.success {
  color: var(--success-text);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.submit-status.success a {
  color: var(--primary-600);
  font-weight: 600;
}
