/* ===== OSEM Registration Form Styles ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #1a3c6e;
  --primary-light: #2a5298;
  --accent:      #e8740c;
  --success:     #1e7e34;
  --danger:      #c0392b;
  --bg:          #f4f6fb;
  --card-bg:     #ffffff;
  --border:      #d0d7e3;
  --text:        #1a1f2e;
  --text-muted:  #6b7a99;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(26,60,110,0.08);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 24px 16px 48px;
}

/* ===== Page Wrapper ===== */
.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* ===== Header ===== */
.form-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 24px 32px;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
}
.header-logos { display: flex; align-items: center; gap: 20px; }
.logo-placeholder {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.header-text h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.header-sub { font-size: 0.9rem; opacity: 0.85; }
.header-stage {
  display: inline-block;
  margin-top: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ===== Legend Bar ===== */
.legend-bar {
  background: #e8eef7;
  border-left: 4px solid var(--primary);
  padding: 10px 24px;
  display: flex;
  gap: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.legend-bar strong { color: var(--text); }

/* ===== Alert ===== */
.alert {
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 500;
}
.alert-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.alert-error   { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }

/* ===== Form Section ===== */
.form-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f0f4fb;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}
.section-num {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.section-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section-body { padding: 24px; }

/* ===== Form Groups ===== */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text);
}
label small { font-weight: 400; color: var(--text-muted); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42,82,152,0.12);
}
input.readonly-field {
  background: #f0f4fb;
  color: var(--text-muted);
  cursor: not-allowed;
}
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1) !important;
}
textarea { resize: vertical; min-height: 100px; }

/* ===== Two Column Grid ===== */
.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .form-row.two-col { grid-template-columns: 1fr; }
}

/* ===== Badges ===== */
.badge-m, .badge-o, .badge-c {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.badge-m { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }
.badge-o { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.badge-c { background: #fff8e1; color: #856404; border: 1px solid #ffeaa7; }

/* ===== Radio & Checkbox Groups ===== */
.radio-group, .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafd;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}
.radio-group.is-invalid, .checkbox-group.is-invalid {
  border-color: var(--danger);
  background: #fff5f5;
}
.radio-label, .check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 0;
}
.radio-label input, .check-label input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

/* ===== Hints & Errors ===== */
.hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.field-error {
  display: block;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
  min-height: 1em;
}
.char-counter {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Prefix Input ===== */
.input-prefix-wrap { display: flex; align-items: stretch; }
.input-prefix-wrap .prefix {
  background: #f0f4fb;
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 9px 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 1rem;
}
.input-prefix-wrap input {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ===== Conditional Blocks ===== */
.conditional-block { margin-bottom: 24px; }
.conditional-block:last-child { margin-bottom: 0; }
.conditional-block.hidden { display: none; }
.sub-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8eef7;
}
.info-placeholder {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: #f8fafd;
  border-radius: var(--radius);
  border: 1.5px dashed var(--border);
}

/* ===== Consent Blocks ===== */
.consent-block {
  background: #f8fafd;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
}
.consent-block:last-of-type { margin-bottom: 0; }
.consent-text { margin-bottom: 10px; }
.consent-text strong { color: var(--primary); display: block; margin-bottom: 4px; }
.consent-text p { font-size: 0.88rem; color: var(--text-muted); }
.consent-check { font-size: 0.88rem; font-weight: 600; color: var(--text); }

/* ===== Actions ===== */
.form-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 24px 0 8px;
}
.btn-submit {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border: none;
  padding: 13px 40px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
  min-width: 200px;
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-reset {
  background: #fff;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  padding: 13px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-reset:hover { background: #f0f4fb; }
