:root {
  --otf-bg: #f6f8fb;
  --otf-panel: #f8f8f8;
  --otf-card: #fff;
  --otf-text: #222;
  --otf-muted: #555;
  --otf-border: #ebebeb;
  --otf-accent: #6b21a8;
  --otf-accent-2: #2f8be6;
  --otf-danger: #cc1f1f;
  --otf-shadow: 0 8px 22px rgba(13, 40, 80, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #e9f2ff 0%, var(--otf-bg) 30%, var(--otf-bg) 100%);
  color: var(--otf-text);
  font-family: "Roboto Slab", Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.6;
}

h2 {
  margin: 0;
  font-size: 30px;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  display: block;
  border: 1px solid var(--otf-border);
  min-height: 50px;
  padding: 0 20px;
  background: #fff;
  color: var(--otf-text);
  font-weight: 700;
  border-radius: 0;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #d8d8d8;
  box-shadow: none;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
  padding: 0;
  accent-color: var(--otf-accent);
}

select {
  min-height: 50px;
  padding-right: 48px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--otf-accent) 50%),
    linear-gradient(135deg, var(--otf-accent) 50%, transparent 50%),
    linear-gradient(to right, #f3ecfa, #f3ecfa);
  background-position:
    calc(100% - 24px) 22px,
    calc(100% - 16px) 22px,
    calc(100% - 50px) 0;
  background-size:
    8px 8px,
    8px 8px,
    1px 100%;
  background-repeat: no-repeat;
}

select:hover {
  border-color: #d8d8d8;
}

select:focus {
  border-color: var(--otf-accent);
  background-image:
    linear-gradient(45deg, var(--otf-accent) 50%, transparent 50%),
    linear-gradient(135deg, transparent 50%, var(--otf-accent) 50%),
    linear-gradient(to right, #f3ecfa, #f3ecfa);
}

select:disabled {
  cursor: not-allowed;
  color: #777;
  background-color: #f3f3f3;
  background-image:
    linear-gradient(45deg, transparent 50%, #aaa 50%),
    linear-gradient(135deg, #aaa 50%, transparent 50%),
    linear-gradient(to right, #e8e8e8, #e8e8e8);
}

select option {
  color: var(--otf-text);
  font-weight: 700;
}

.main {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0 24px;
}

.otf-page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 12px;
  padding: 18px 14px 14px;
  border: 1px solid #d8e0ea;
  border-radius: 14px;
  background: var(--otf-card);
  box-shadow: var(--otf-shadow);
  text-align: center;
}

.logo {
  width: min(190px, 72vw);
  height: auto;
  margin: 0 auto 12px;
  display: block;
}

.agent-name {
  margin: 2px 0;
  color: #5d6b7d;
  font-size: 0.94rem;
  font-weight: 400;
}

.agent-line {
  margin: 2px 0;
  color: #5d6b7d;
  font-size: 0.94rem;
}

.agent-role {
  margin: 4px 0;
  color: var(--otf-text);
  font-size: 1.08rem;
  font-weight: 700;
}

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  background: var(--otf-card);
  border: 1px solid #d8e0ea;
  border-radius: 14px;
  box-shadow: var(--otf-shadow);
  overflow: hidden;
}

.wizard {
  display: block;
  width: 100%;
  overflow: hidden;
}

.wizard > .content,
.wizard > .actions {
  width: 100%;
  background: var(--otf-panel);
}

.actions ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.content h3 {
  display: none;
}

fieldset {
  margin: 0;
  padding: 28px 30px 20px;
  border: 0;
}

p.desc,
p.desc2 {
  margin: 0 0 40px;
  color: var(--otf-muted);
}

.fieldset-content {
  max-width: 100%;
}

.form-group {
  position: relative;
  margin-bottom: 18px;
}

.form-label {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  font-size: 16px;
}

.radio-inline-group {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 6px;
}

.radio-inline-group .radio-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  line-height: 1.2;
  color: var(--otf-text);
  cursor: pointer;
}

.radio-inline-group .radio-item input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.readonly-input {
  background: #f3f3f3;
  color: #555;
}

.upload-card {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px dashed #c9c9c9;
  background: #fff;
}

.upload-card .form-label {
  margin-bottom: 6px;
}

.upload-conditional[hidden] {
  display: none !important;
}

.upload-debug-panel {
  display: none;
  max-height: 180px;
  margin-top: 12px;
  overflow: auto;
  padding: 10px;
  border-radius: 4px;
  background: #111;
  color: #d7ffd7;
  font-family: monospace;
  font-size: 12px;
}

.declaracion-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
}

#declaracion_jurada {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex: 0 0 auto;
}

.declaracion-text {
  margin: 0;
  color: var(--otf-text);
  font-size: 14px;
  line-height: 1.5;
}

.signature-container {
  width: 100%;
  max-width: 640px;
  margin-right: auto;
  margin-left: auto;
  padding: 5px;
  border: 2px solid #000;
  border-radius: 6px;
  background: #f2f2f2;
}

#signature-pad {
  display: block;
  width: 100%;
  height: 220px;
  background: #f2f2f2;
  touch-action: none;
}

.signature-actions {
  margin-top: 12px;
  text-align: center;
}

.signature-actions button,
.actions button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.signature-actions button {
  width: auto;
  padding: 8px 16px;
  border-radius: 4px;
  background: var(--otf-accent-2);
  color: #fff;
}

.status-message {
  margin-top: 12px;
  font-size: 14px;
}

body.is-submitting-form {
  overflow: hidden;
}

.submit-loading-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 11, 30, 0.46);
}

.submit-loading-modal[hidden] {
  display: none;
}

.submit-loading-box {
  width: min(280px, 100%);
  padding: 24px 22px;
  border: 1px solid #eadff6;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 22px 52px rgba(31, 22, 48, 0.24);
  text-align: center;
}

.submit-loading-box p {
  margin: 14px 0 0;
  color: var(--otf-text);
  font-size: 16px;
  font-weight: 700;
}

.submit-loading-spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  border: 4px solid #eadff6;
  border-top-color: var(--otf-accent);
  border-radius: 50%;
  animation: submitSpin 0.85s linear infinite;
}

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

.actions {
  padding: 0 30px 30px;
}

.actions ul {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0;
}

.actions button {
  min-width: 118px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--otf-accent);
  color: #fff;
}

.actions button:disabled {
  background: #e8e8e8;
  color: #999;
  cursor: default;
}

.actions .wizard-status:disabled {
  min-width: 72px;
  border: 1px solid #d9c0f1;
  background: #f3ecfa;
  color: var(--otf-accent);
  opacity: 1;
}

.wizard-required-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid #e6d8f3;
  border-radius: 8px;
  background: #faf7fd;
  color: var(--otf-muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.final-thanks-screen {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.final-thanks-screen h2 {
  margin: 0;
  color: var(--otf-text);
  font-size: 42px;
  line-height: 1.2;
}

.filepond--root {
  font-family: inherit;
}

@media screen and (max-width: 1024px) {
  .container,
  .wizard > .content,
  .wizard > .actions {
    width: 100%;
  }
}

@media screen and (max-width: 768px) {
  fieldset {
    padding: 24px 18px 18px;
  }

  .actions {
    padding: 0 18px 24px;
  }

  .actions ul {
    gap: 8px;
  }

  .final-thanks-screen h2 {
    font-size: 30px;
  }
}

@media screen and (max-width: 480px) {
  .main {
    width: 100%;
    padding: 0;
  }

  .otf-page-header,
  .container {
    width: 100%;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  fieldset {
    padding: 22px 16px;
  }

  .radio-inline-group {
    gap: 12px;
  }

  .actions button {
    min-width: 92px;
    padding: 0 12px;
  }
}
