:root {
  --anavex-blue: #1f5fa8;
  --anavex-blue-dark: #144477;
  --anavex-orange: #f28e2b;
  --panel-blue: #dce9f5;
  --label-gray: #e9e9e9;
  --border: #333333;
  --text: #1a1a1a;
  --muted: #5a6472;
  --danger: #a94442;
  --danger-bg: #fdecea;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #f4f6f9;
}

a { color: var(--anavex-blue); }

.centered-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(20, 40, 70, 0.12);
  padding: 40px 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.auth-logo { max-width: 220px; margin-bottom: 18px; }
.auth-card h1 { font-size: 20px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 14px; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-block { display: block; width: 100%; margin-top: 18px; }
.btn-primary { background: var(--anavex-blue); color: #fff; }
.btn-primary:hover { background: var(--anavex-blue-dark); }
.btn-secondary { background: #fff; color: var(--anavex-blue); border-color: var(--anavex-blue); }
.btn-secondary:hover { background: #eef4fb; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-small { padding: 5px 10px; font-size: 12.5px; }

.app-header {
  background: #fff;
  border-bottom: 1px solid #dde3ea;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header .brand { display: flex; align-items: center; gap: 12px; }
.app-header img { height: 32px; }
.app-header h2 { font-size: 16px; margin: 0; font-weight: 600; }
.app-header .who { font-size: 13px; color: var(--muted); text-align: right; }
.app-header .who a { margin-left: 10px; font-size: 12.5px; }

.page-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(20, 40, 70, 0.06);
  padding: 26px 28px;
  margin-bottom: 24px;
}

.card h2 { margin-top: 0; font-size: 17px; }

.instructions {
  background: var(--panel-blue);
  border: 1px solid #b9d3ea;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 13.5px;
  color: #274a6b;
  margin-bottom: 22px;
}
.instructions ol { margin: 6px 0 0 20px; padding: 0; }

.section-bar {
  background: var(--panel-blue);
  border-radius: 6px 6px 0 0;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
  color: #274a6b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-body {
  border: 1px solid #cfd9e4;
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 14px;
  margin-bottom: 24px;
}

.repeatable-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e7ee;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fafbfd;
  position: relative;
}
.account-row { grid-template-columns: 1fr 1fr auto; align-items: end; }
.access-row { grid-template-columns: 1fr; }
.access-row .choice-groups { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 8px; }

.field-hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

label { font-size: 12.5px; font-weight: 600; color: #33475b; display: block; margin-bottom: 4px; }
input[type=text], input[type=email] {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #c6cdd6;
  border-radius: 5px;
}
input[readonly] { background: #f0f2f5; color: #555; }
textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #c6cdd6;
  border-radius: 5px;
  font-family: inherit;
}

fieldset.choice-group {
  border: 1px solid #c6cdd6;
  border-radius: 5px;
  padding: 8px 12px;
  margin: 0;
}
fieldset.choice-group legend { font-size: 12.5px; font-weight: 600; color: #33475b; padding: 0 4px; }
.radio-line { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 13.5px; }
.radio-line input { margin: 0; }

.remove-row-btn {
  background: none;
  border: 1px solid #d9534f;
  color: #d9534f;
  border-radius: 5px;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  height: fit-content;
}
.remove-row-btn:hover { background: var(--danger-bg); }

.add-row-btn {
  background: #fff;
  border: 1px dashed var(--anavex-blue);
  color: var(--anavex-blue);
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.add-row-btn:hover { background: #eef4fb; }

.conditional-field { margin-top: 10px; display: none; }
.conditional-field.active { display: block; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.error-box {
  background: var(--danger-bg);
  border: 1px solid #f5c2c0;
  color: var(--danger);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
}
.error-box ul { margin: 6px 0 0 18px; padding: 0; }

.pdf-frame-wrap {
  border: 1px solid #cfd9e4;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}
.pdf-frame-wrap iframe { width: 100%; height: 900px; border: none; display: block; }

.status-banner {
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 22px;
  font-size: 14px;
}
.status-banner.success { background: #e9f6ec; border: 1px solid #bfe3c8; color: #276b39; }

.summary-list { font-size: 13.5px; color: #33475b; }
.summary-list dt { font-weight: 600; margin-top: 8px; }
.summary-list dd { margin: 2px 0 0; }

.stub-note {
  background: #fff7e6;
  border: 1px solid #f0cf8a;
  color: #7a5a12;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .account-row { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pdf-frame-wrap iframe { height: 600px; }
}
