:root {
  --primary: #1e3a5f;
  --primary-light: #2c5282;
  --text: #1a202c;
  --text-muted: #4a5568;
  --bg: #f7fafc;
  --white: #ffffff;
  --border: #cbd5e0;
  --border-focus: #1e3a5f;
  --success-bg: #f0fff4;
  --success-text: #276749;
  --error-bg: #fff5f5;
  --error-text: #c53030;
  --info-bg: #ebf8ff;
  --info-text: #2b6cb0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand__text h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.brand__text p {
  margin: 2px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  background: var(--primary);
  color: var(--white);
}

.main {
  padding: 40px 0 60px;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary);
}

.page-header p {
  margin: 12px auto 0;
  max-width: 600px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow);
}

.card__info {
  display: flex;
  gap: 16px;
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid #e2e8f0;
  margin-bottom: 28px;
}

.info-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #cbd5e0;
  border-radius: 50%;
  color: var(--text-muted);
}

.info-content p {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.info-content p:last-child {
  margin-bottom: 0;
}

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

.form-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

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

.form-group--flex {
  flex: 1;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.required {
  color: var(--error-text);
}

.form-group input,
.form-group select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  padding: 0 14px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder {
  color: #a0aec0;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-group input.error,
.form-group select.error {
  border-color: var(--error-text);
  box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.1);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-actions {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

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

.btn-icon {
  flex-shrink: 0;
}

.message {
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.9rem;
  text-align: center;
}

.message--error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid #feb2b2;
}

.message--success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #9ae6b4;
}

.message--info {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid #90cdf4;
}

.message__content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(43, 108, 176, 0.2);
  border-top-color: var(--info-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

.result {
  margin-top: 24px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  overflow: hidden;
}

.result__header {
  background: var(--primary);
  color: var(--white);
  padding: 16px 20px;
}

.result__header h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 500;
}

.result__header p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.result__body {
  padding: 20px;
  background: var(--white);
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: #edf2f7;
  border: 1px solid #e2e8f0;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.download-link:hover {
  background: #e2e8f0;
}

.footer-min {
  background: var(--primary);
  padding: 20px 0;
}

.footer-min p {
  margin: 0;
  text-align: center;
  color: var(--white);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }

  .topbar__content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header h2 {
    font-size: 1.5rem;
  }

  .card {
    padding: 24px;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
  }
}