:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f7f8f9;
  --border: #e6e6e6;
  --border-strong: #c8c8c8;
  --text: #1b1b1e;
  --text-muted: #494d50;
  --text-dim: #758696;
  --accent: #5bacbb;
  --accent-hover: #4a98a6;
  --accent-soft: #6fcbdc;
  --success: #6bc153;
  --danger: #c0392b;
  --header-bg: #151419;
  --radius: 6px;
  --font: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 20px 32px;
  background: var(--header-bg);
  display: flex;
  align-items: center;
}

.header img {
  height: 32px;
  width: auto;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 48px 24px 64px;
}

.container {
  width: 100%;
  max-width: 640px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.subtitle {
  color: var(--text-muted);
  margin: 0 0 32px;
  font-size: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 1px 2px rgba(20, 20, 25, 0.04), 0 4px 12px rgba(20, 20, 25, 0.04);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 16px;
}

.section + .section { margin-top: 28px; }

.field { margin-bottom: 16px; }

.row { display: flex; gap: 16px; }
.row .field { flex: 1; }

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

label .req { color: var(--accent); margin-left: 2px; }
label .opt { color: var(--text-dim); font-weight: 400; margin-left: 4px; font-size: 12px; }

input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder { color: var(--text-dim); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 172, 187, 0.18);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235bacbb' d='M6 8 0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
  display: none;
}
.field.has-error .error-text { display: block; }
.field.has-error input,
.field.has-error select { border-color: var(--danger); }

.actions {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

button.primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(20, 20, 25, 0.08);
}
button.primary:hover { background: var(--accent-hover); }
button.primary:disabled { background: var(--border-strong); color: #ffffff; cursor: not-allowed; box-shadow: none; }

.footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

/* Confirmation state */
.confirmation {
  text-align: center;
  padding: 16px 8px;
}
.confirmation .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(107, 193, 83, 0.12);
  border: 2px solid var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--success);
  font-size: 32px;
}
.confirmation h2 { margin: 0 0 12px; font-size: 24px; }
.confirmation p { color: var(--text-muted); margin: 0 0 12px; }
.confirmation .ref-id {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 14px;
  color: var(--accent);
}

.hidden { display: none !important; }

@media (max-width: 560px) {
  .row { flex-direction: column; gap: 0; }
  .card { padding: 20px; }
  .main { padding: 24px 16px 48px; }
  h1 { font-size: 24px; }
}
