/* Ascenterra — Global Styles */

:root {
  --navy: #1a2744;
  --navy-mid: #2a3d6b;
  --navy-light: #e8ecf4;
  --accent: #2e6fac;
  --accent-hover: #1f5490;
  --text-primary: #1a2744;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border: #d1dae8;
  --border-light: #eaeff7;
  --surface: #ffffff;
  --surface-alt: #f7f9fc;
  --error: #c0392b;
  --error-bg: #fdf2f2;
  --success: #1a6b3a;
  --success-bg: #f0faf4;
  --radius: 6px;
  --radius-lg: 10px;
}

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

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--surface-alt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */

.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--accent);
  padding: 0 2rem;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.wordmark {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.wordmark span {
  color: #a8c4e0;
  font-weight: 400;
}

nav a {
  color: #a8c4e0;
  text-decoration: none;
  font-size: 0.875rem;
  margin-left: 1.5rem;
  transition: color 0.15s;
}

nav a:hover { color: #ffffff; }

.site-footer {
  background: var(--navy);
  border-top: 1px solid var(--navy-mid);
  padding: 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-inner p {
  color: #6b82a8;
  font-size: 0.8rem;
}

/* ── Page containers ── */

.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page-container.narrow {
  max-width: 680px;
}

/* ── Hero (home page) ── */

.hero {
  background: var(--navy);
  padding: 5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--navy-mid);
}

.hero h1 {
  color: #ffffff;
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.hero p {
  color: #a8c4e0;
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-secondary:hover { background: var(--navy-light); }

/* ── Cards ── */

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--navy-light);
}

/* ── Section headings ── */

.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1rem;
}

.section-lead {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 2rem;
}

/* ── Feature grid (home page) ── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.feature-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.feature-item h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.feature-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Form styles ── */

.form-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--navy-light);
}

.form-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.375rem;
}

.form-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-section {
  margin-bottom: 1.75rem;
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border-light);
}

.form-group {
  margin-bottom: 1.125rem;
}

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

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

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

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

label .optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 4px;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 111, 172, 0.12);
}

input[type="text"].error,
input[type="email"].error,
select.error,
textarea.error {
  border-color: var(--error);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.6;
}

.char-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.25rem;
}

.char-count.near-limit { color: #b7791f; }
.char-count.at-limit   { color: var(--error); }

/* File input */

.file-input-wrapper {
  position: relative;
}

.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--surface-alt);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--navy-light);
}

.file-drop-zone.error {
  border-color: var(--error);
}

.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-drop-zone .drop-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.file-drop-zone .drop-label strong {
  color: var(--accent);
}

.file-selected {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--navy-light);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--navy);
}

.file-selected.visible { display: flex; }

.file-remove {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.25rem;
}

.file-remove:hover { color: var(--error); }

.file-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Field errors */

.field-error {
  display: none;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 0.3rem;
}

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

/* Form actions */

.form-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Submission states */

.submission-notice {
  display: none;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.submission-notice.visible { display: block; }

.submission-notice.success {
  background: var(--success-bg);
  border: 1px solid #9ae6b4;
}

.submission-notice.error-notice {
  background: var(--error-bg);
  border: 1px solid #feb2b2;
}

.submission-notice h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.submission-notice.success h3 { color: var(--success); }
.submission-notice.error-notice h3 { color: var(--error); }

.submission-notice p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.submission-notice .ref-id {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--navy-light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Spinner */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* ── Info panel ── */

.info-panel {
  background: var(--navy-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .hero h1 { font-size: 1.75rem; }
  .page-container { padding: 2rem 1rem; }
  .card { padding: 1.25rem; }
}
