:root {
  color-scheme: dark;
  --bg: #375260;
  --bg-deep: #2f4652;
  --surface: rgba(70, 107, 127, 0.86);
  --surface-strong: rgba(44, 71, 84, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.74);
  --accent: #fd5409;
  --accent-strong: #ff6f2e;
  --success: #c7f1d6;
  --danger: #ffd0c0;
  --shadow: 0 32px 80px rgba(8, 20, 27, 0.35);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.15), transparent 32%),
    radial-gradient(circle at 85% 15%, rgba(253, 84, 9, 0.12), transparent 18%),
    linear-gradient(180deg, #466b7f 0%, var(--bg) 46%, var(--bg-deep) 100%);
}

.ficha-body {
  color-scheme: light;
  --bg: #eef3f7;
  --bg-deep: #e5edf3;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-soft: #f7fafc;
  --border: rgba(23, 48, 59, 0.14);
  --text: #17303b;
  --muted: rgba(23, 48, 59, 0.7);
  --success: #177245;
  --danger: #b53d17;
  --shadow: 0 28px 72px rgba(23, 48, 59, 0.12);
  background:
    radial-gradient(circle at top left, rgba(253, 84, 9, 0.08), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(23, 48, 59, 0.06), transparent 22%),
    linear-gradient(180deg, #fafcfe 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(10px);
  opacity: 0.4;
}

body::before {
  top: -10rem;
  right: -6rem;
  background: rgba(255, 255, 255, 0.12);
}

body::after {
  bottom: -12rem;
  left: -8rem;
  background: rgba(253, 84, 9, 0.1);
}

.page-shell {
  padding: 32px 20px 48px;
}

.layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(300px, 0.92fr) minmax(340px, 1fr);
  align-items: stretch;
}

.layout > * {
  min-width: 0;
}

.hero-card,
.form-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(70, 107, 127, 0.92), rgba(46, 71, 84, 0.95));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ficha-body .hero-card,
.ficha-body .form-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98));
}

.hero-card {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-card::after,
.form-card::before {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-card::after {
  right: -120px;
  bottom: -140px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.form-card::before {
  top: -100px;
  left: -90px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 65%);
}

.brand-pill,
.eyebrow,
.section-kicker {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-pill {
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.75rem;
  font-weight: 700;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 600;
}

h1,
h2,
legend {
  margin: 0;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 1.02;
  max-width: 10ch;
}

.hero-copy,
.section-copy {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-grid {
  display: grid;
  gap: 14px;
}

.hero-stat {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
}

.ficha-body .hero-stat {
  border-color: rgba(23, 48, 59, 0.1);
  background: rgba(244, 247, 250, 0.95);
}

.hero-stat strong,
.hero-stat span {
  display: block;
}

.hero-stat strong {
  margin-bottom: 8px;
  font-size: 1rem;
}

.hero-stat span {
  color: var(--muted);
  line-height: 1.6;
}

.form-card {
  padding: 34px;
}

.card-header {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
  display: grid;
  gap: 10px;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field,
.field-group {
  display: grid;
  gap: 10px;
}

.field > span,
.field-group legend {
  font-size: 0.97rem;
  font-weight: 600;
}

input,
select,
.submit-button {
  font: inherit;
}

input,
select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  background: rgba(17, 31, 39, 0.22);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.ficha-body input,
.ficha-body select {
  border-color: rgba(23, 48, 59, 0.14);
  background: #ffffff;
  color: #17303b;
}

.ficha-body input::placeholder {
  color: rgba(23, 48, 59, 0.42);
}

input:focus,
select:focus {
  border-color: rgba(253, 84, 9, 0.85);
  background: rgba(17, 31, 39, 0.28);
  transform: translateY(-1px);
}

.ficha-body input:focus,
.ficha-body select:focus {
  background: #ffffff;
}

select option {
  color: #112129;
}

.field-group {
  margin: 6px 0 0;
  padding: 0;
  border: 0;
}

.radio-list {
  display: grid;
  gap: 12px;
}

.radio-option,
.checkbox-option {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.ficha-body .brand-pill {
  background: rgba(253, 84, 9, 0.1);
  color: #b4470f;
}

.ficha-body .eyebrow,
.ficha-body .section-kicker,
.ficha-body .hero-copy,
.ficha-body .section-copy,
.ficha-body .radio-option,
.ficha-body .checkbox-option,
.ficha-body .hero-stat span,
.ficha-body .section-heading span,
.ficha-body .signature-hint,
.ficha-body .form-feedback {
  color: var(--muted);
}

.radio-option input,
.checkbox-option input {
  width: 22px;
  height: 22px;
  min-height: auto;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.radio-option span,
.checkbox-option span {
  line-height: 1.5;
}

.checkbox-option {
  margin-top: 2px;
}

.feedback-stack {
  display: grid;
  gap: 10px;
}

.feedback-message {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
}

.feedback-error {
  background: rgba(253, 84, 9, 0.16);
  color: var(--danger);
  border: 1px solid rgba(253, 84, 9, 0.3);
}

.feedback-success {
  background: rgba(111, 233, 158, 0.14);
  color: var(--success);
  border: 1px solid rgba(111, 233, 158, 0.24);
}

.submit-button {
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 18px 32px rgba(253, 84, 9, 0.28);
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 36px rgba(253, 84, 9, 0.35);
}

.submit-button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.submit-button.is-hidden,
.ghost-button.is-hidden {
  display: none;
}

.radio-list-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkbox-option-block {
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.ficha-body .checkbox-option-block {
  border-color: rgba(23, 48, 59, 0.12);
  background: #f8fafc;
}

.ficha-layout {
  width: min(960px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

.ficha-layout > * {
  min-width: 0;
}

.ficha-hero-top {
  padding: 32px;
  display: grid;
  gap: 22px;
}

.hero-copy-block {
  display: grid;
  gap: 14px;
}

.ficha-hero-top h1 {
  max-width: 12ch;
}

.ficha-card form {
  gap: 22px;
}

.form-section {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.ficha-body .form-section {
  border-color: rgba(23, 48, 59, 0.08);
  background: #f8fafc;
}

.section-heading {
  display: grid;
  gap: 6px;
}

.section-heading strong {
  font-size: 1rem;
}

.section-heading span {
  color: var(--muted);
  line-height: 1.5;
}

.field-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-banner {
  margin-bottom: 18px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  line-height: 1.5;
}

.status-banner-info {
  color: #fff0d8;
  background: rgba(255, 196, 94, 0.12);
  border: 1px solid rgba(255, 196, 94, 0.32);
}

.ficha-body .status-banner-info {
  color: #8a5a00;
  background: rgba(255, 196, 94, 0.16);
  border-color: rgba(255, 196, 94, 0.3);
}

.status-banner-success {
  color: var(--success);
  background: rgba(111, 233, 158, 0.12);
  border: 1px solid rgba(111, 233, 158, 0.24);
}

.ficha-body .status-banner-success {
  background: rgba(23, 114, 69, 0.1);
  border-color: rgba(23, 114, 69, 0.18);
}

.status-banner-danger {
  color: var(--danger);
  background: rgba(253, 84, 9, 0.14);
  border: 1px solid rgba(253, 84, 9, 0.3);
}

.ficha-body .status-banner-danger {
  background: rgba(181, 61, 23, 0.1);
  border-color: rgba(181, 61, 23, 0.18);
}

.signature-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 31, 39, 0.2);
}

.ficha-body .signature-panel {
  border-color: rgba(23, 48, 59, 0.1);
  background: #ffffff;
}

.signature-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.ficha-body .ghost-button {
  border-color: rgba(23, 48, 59, 0.14);
  color: #17303b;
  background: #ffffff;
}

#signature-pad {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.28);
  background: #21404c;
  touch-action: none;
}

.ficha-body #signature-pad {
  border-color: rgba(23, 48, 59, 0.18);
  background: #f4f8fb;
}

#signature-pad.is-readonly {
  opacity: 0.9;
}

.signature-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-feedback {
  min-height: 24px;
  color: var(--muted);
  line-height: 1.5;
}

.form-feedback.is-error {
  color: var(--danger);
}

.form-feedback.is-success {
  color: var(--success);
}

.registered-sheet {
  position: relative;
  z-index: 1;
}

.registered-document {
  display: grid;
  gap: 24px;
  padding: 30px;
  border-radius: 24px;
  border: 1px solid rgba(23, 48, 59, 0.1);
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(23, 48, 59, 0.08);
}

.registered-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(23, 48, 59, 0.08);
}

.registered-kicker {
  margin: 0 0 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(180, 71, 15, 0.9);
}

.registered-header h3,
.registered-section h4 {
  margin: 0;
  color: #17303b;
}

.registered-copy {
  margin: 8px 0 0;
  color: rgba(23, 48, 59, 0.66);
  line-height: 1.6;
}

.registered-meta {
  display: grid;
  gap: 8px;
  min-width: 240px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #f6f9fc;
  border: 1px solid rgba(23, 48, 59, 0.08);
}

.registered-meta span,
.registered-signature-meta span {
  display: block;
  color: rgba(23, 48, 59, 0.82);
  line-height: 1.5;
  word-break: break-word;
}

.registered-section {
  display: grid;
  gap: 16px;
}

.registered-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registered-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(23, 48, 59, 0.08);
}

.registered-item-wide {
  grid-column: 1 / -1;
}

.registered-label {
  color: rgba(23, 48, 59, 0.58);
  font-size: 0.88rem;
}

.registered-value {
  color: #17303b;
  line-height: 1.6;
  word-break: break-word;
}

.registered-section-signature {
  padding-top: 4px;
}

.registered-signature-block {
  display: grid;
  gap: 18px;
}

.registered-signature-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(23, 48, 59, 0.08);
}

.registered-signature-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(23, 48, 59, 0.18);
  background: #ffffff;
}

.registered-signature-image {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.registered-empty-signature {
  color: rgba(23, 48, 59, 0.54);
}

.is-hidden {
  display: none;
}

@media (max-width: 980px) {
  .ficha-layout {
    grid-template-columns: 1fr;
  }

  .registered-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .registered-meta {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 18px 14px 30px;
  }

  .hero-card,
  .form-card {
    padding: 22px;
    border-radius: 22px;
  }

  .ficha-hero-top {
    padding: 22px;
    gap: 18px;
  }

  .ficha-hero-top h1 {
    max-width: 100%;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .field-row-3,
  .ficha-layout,
  .registered-grid {
    grid-template-columns: 1fr;
  }

  .radio-list-inline {
    grid-template-columns: 1fr;
  }

  .checkbox-option-block {
    padding: 16px;
  }

  .form-section {
    padding: 18px;
  }

  .signature-panel {
    padding: 14px;
  }

  #signature-pad {
    height: 180px;
  }

  .registered-document {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .registered-item,
  .registered-meta,
  .registered-signature-card {
    padding: 14px;
    border-radius: 16px;
  }

  h1 {
    max-width: 100%;
  }
}
