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

:root {
  --color-primary: #1e3a5f;
  --color-primary-dark: #152b47;
  --color-primary-light: #2a5285;
  --color-accent: #2e86de;
  --color-accent-hover: #1a6fc4;
  --color-bg: #eef2f7;
  --color-card: #ffffff;
  --color-border: #c8d6e5;
  --color-border-focus: #2e86de;
  --color-text: #1a2535;
  --color-text-muted: #5a6a7e;
  --color-label: #344055;
  --color-success-bg: #f0faf4;
  --color-success-border: #2ecc71;
  --color-success-text: #1a7a42;
  --color-success-icon: #27ae60;
  --color-error-bg: #fff5f5;
  --color-error-border: #e74c3c;
  --color-error-text: #c0392b;
  --color-section-title: #2a5285;
  --color-required: #e74c3c;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 24px rgba(30, 58, 95, 0.10), 0 1px 4px rgba(30, 58, 95, 0.06);
  --shadow-card-hover: 0 8px 32px rgba(30, 58, 95, 0.14);
  --transition: 0.18s ease;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background-color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.header-logo svg {
  color: #7ec8f4;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  padding: 28px 32px;
}

.card-title {
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.card-subtitle {
  color: #a8c8e8;
  font-size: 0.92rem;
  line-height: 1.55;
}

form {
  padding: 0;
}

.form-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--color-border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-section-title);
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 540px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-label);
}

.required {
  color: var(--color-required);
  margin-left: 2px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.938rem;
  font-family: var(--font);
  color: var(--color-text);
  background-color: #f8fafd;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: #9aaaba;
}

.form-input:hover,
.form-select:hover {
  border-color: #9ab4d0;
  background-color: #ffffff;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--color-border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(46, 134, 222, 0.15);
}

.form-input.is-invalid,
.form-select.is-invalid {
  border-color: var(--color-error-border);
  background-color: #fff8f8;
}

.form-input.is-invalid:focus,
.form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.13);
}

input[type="date"].form-input {
  cursor: pointer;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--color-text-muted);
  pointer-events: none;
}

.select-wrapper .form-select {
  padding-right: 38px;
  cursor: pointer;
}

.radio-fieldset {
  border: none;
  padding: 0;
}

.radio-fieldset legend {
  margin-bottom: 10px;
}

.radio-group {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.radio-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: #f8fafd;
  flex-shrink: 0;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.radio-custom::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform var(--transition);
}

.radio-input:checked + .radio-custom {
  border-color: var(--color-accent);
  background: #ffffff;
}

.radio-input:checked + .radio-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

.radio-input:focus + .radio-custom {
  box-shadow: 0 0 0 3px rgba(46, 134, 222, 0.18);
}

.radio-label:hover .radio-custom {
  border-color: #9ab4d0;
}

.radio-text {
  font-size: 0.938rem;
  color: var(--color-text);
  font-weight: 500;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 32px 4px;
}

.alert[hidden] {
  display: none;
}

.alert svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-error {
  background-color: var(--color-error-bg);
  border: 1.5px solid var(--color-error-border);
  color: var(--color-error-text);
}

.alert-error svg {
  color: var(--color-error-border);
}

.form-actions {
  padding: 20px 32px 32px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary-light) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity var(--transition), box-shadow var(--transition), transform var(--transition);
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(46, 134, 222, 0.35);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(46, 134, 222, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(46, 134, 222, 0.3);
}

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

.btn-primary.loading {
  position: relative;
}

.btn-primary.loading::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 4px;
}

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

.success-card {
  text-align: center;
  padding: 48px 32px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #e8faf0 0%, #d4f4e2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-icon svg {
  color: var(--color-success-icon);
}

.success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.success-text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.success-summary {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  text-align: left;
  margin: 0 auto 24px;
  max-width: 480px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--color-text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.summary-value {
  color: var(--color-text);
  text-align: right;
  font-weight: 500;
}

.success-note {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  font-style: italic;
  max-width: 440px;
  margin: 0 auto;
}

.site-footer {
  text-align: center;
  padding: 16px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  background: #ffffff;
}

@media (max-width: 540px) {
  .main-content {
    padding: 20px 12px 40px;
  }

  .card-header {
    padding: 22px 20px;
  }

  .card-title {
    font-size: 1.2rem;
  }

  .form-section {
    padding: 22px 20px;
  }

  .form-actions {
    padding: 16px 20px 24px;
  }

  .alert {
    margin: 0 20px 4px;
  }

  .success-card {
    padding: 36px 20px;
  }
}
