@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap");

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

:root {
    --green: #0c903c;
    --green-dark: #087a32;
    --green-xlight: #e8f7ee;
    --green-glow: rgba(12, 144, 60, .16);
    --white: #ffffff;
    --off-white: #f6faf8;
    --text-primary: #0a1a10;
    --text-secondary: #4a6358;
    --border: rgba(12, 144, 60, .15);
    --border-input: rgba(12, 144, 60, .22);
    --shadow-lg: 0 20px 60px rgba(12, 144, 60, .16);
    --radius: 14px;
    --radius-sm: 10px;
    --font: 'Plus Jakarta Sans', sans-serif;
    --tr: 0.22s cubic-bezier(.4, 0, .2, 1);
}

body,
input,
select,
textarea,
button {
    font-family: var(--font);
}

body {
    background: var(--off-white);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* ── PAGE WRAP ──────────────────────────────────── */
.page-wrap {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── LEFT PANEL ─────────────────────────────────── */
.left-panel {
    width: 38%;
    background: var(--green);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
    top: -120px;
    left: -120px;
    pointer-events: none;
}

.left-panel::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    bottom: -80px;
    right: -60px;
    pointer-events: none;
}

.left-inner {
    position: relative;
    z-index: 1;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100%;
}

.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.left-intro h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.left-intro p {
    font-size: 13.5px;
    color: rgba(255, 255, 255, .75);
    line-height: 1.6;
    font-weight: 400;
}

/* ── STEPPER ────────────────────────────────────── */
.stepper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    border: 2px solid rgba(255, 255, 255, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--tr);
    position: relative;
}

.step-num {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, .8);
    transition: opacity var(--tr);
}

.step-check {
    position: absolute;
    width: 16px;
    height: 16px;
    color: #fff;
    opacity: 0;
    transition: opacity var(--tr);
}

.step-item.active .step-circle {
    background: #fff;
    border-color: #fff;
}

.step-item.active .step-num {
    color: var(--green);
}

.step-item.done .step-circle {
    background: rgba(255, 255, 255, .9);
    border-color: #fff;
}

.step-item.done .step-num {
    opacity: 0;
}

.step-item.done .step-check {
    opacity: 1;
    color: var(--green);
}

.step-label strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.step-label span {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .55);
}

.step-line {
    width: 2px;
    height: 18px;
    background: rgba(255, 255, 255, .2);
    margin-left: 17px;
}

/* ── LEFT ACTIONS ───────────────────────────────── */
.left-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--tr), transform var(--tr);
}

.side-btn:hover {
    background: rgba(255, 255, 255, .2);
    transform: translateX(3px);
}

.side-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── RIGHT PANEL ────────────────────────────────── */
.right-panel {
    width: 62%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.right-inner {
    padding: 44px 52px;
    max-width: 660px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

.form-header {
    margin-bottom: 20px;
}

.form-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -.4px;
    margin-bottom: 4px;
}

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

/* ── PROGRESS BAR ───────────────────────────────── */
.progress-bar-wrap {
    margin-bottom: 28px;
}

.progress-bar-track {
    height: 5px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 99px;
    width: 25%;
    transition: width 0.4s cubic-bezier(.4, 0, .2, 1);
}

/* ── FORM STEPS ─────────────────────────────────── */
.form-step {
    display: none;
    animation: fadeUp 0.3s ease both;
}

.form-step.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── FIELD ──────────────────────────────────────── */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}

.req {
    color: var(--green);
}

.fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 13px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: color var(--tr);
    flex-shrink: 0;
}

.field-icon--top {
    top: 13px;
    align-self: flex-start;
}

.field-wrap input,
.field-wrap select,
.field-wrap textarea {
    width: 100%;
    padding: 0 14px 0 40px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: var(--off-white);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    font-weight: 500;
    outline: none;
    transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
    appearance: none;
}

.field-wrap input,
.field-wrap select {
    height: 46px;
}

.field-wrap textarea {
    padding-top: 12px;
    padding-bottom: 12px;
    resize: vertical;
    min-height: 110px;
}

.field-wrap input::placeholder,
.field-wrap textarea::placeholder {
    color: #a0b5a8;
    font-weight: 400;
}

.field-wrap input:focus,
.field-wrap select:focus,
.field-wrap textarea:focus {
    border-color: var(--green);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--green-glow);
}

.field-wrap:focus-within .field-icon {
    color: var(--green);
}

/* ── MOTIVO CHECKBOXES ─────────────────────────── */
.motivo-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.motivo-group-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border-input);
    margin-bottom: 7px;
    transition: border-color var(--tr), background var(--tr);
}

.check-item:hover {
    border-color: var(--green);
    background: var(--green-xlight);
}

.check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--green);
    flex-shrink: 0;
    cursor: pointer;
}

.check-item span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

/* ── FIRMA ──────────────────────────────────────── */
.firma-section {
    margin-bottom: 8px;
}

.firma-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.firma-wrap {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 180px;
    border: 2px dashed var(--border-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: crosshair;
    background: #fafbff;
    transition: border-color var(--tr);
    margin: 0 auto;
}

.firma-wrap:hover {
    border-color: var(--green);
}

.firma-wrap.has-firma {
    border-style: solid;
    border-color: var(--green);
}

.firma-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    transition: opacity var(--tr);
}

.firma-placeholder.hidden {
    opacity: 0;
}

.firma-placeholder svg {
    width: 36px;
    height: 36px;
    margin-bottom: 4px;
}

.firma-placeholder p {
    font-size: 13px;
    color: #a0b5a8;
    font-weight: 500;
}

.firma-placeholder span {
    font-size: 11.5px;
    color: #c0d4ca;
}

#signature-pad {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#firma-imagen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.firma-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 7px;
    font-size: 12px;
    color: var(--text-secondary);
}

.firma-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d0d5e8;
    flex-shrink: 0;
    transition: background var(--tr);
}

.firma-dot.signed {
    background: var(--green);
}

.firma-tools {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.firma-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--tr);
}

.firma-btn svg {
    width: 14px;
    height: 14px;
}

.firma-btn--clear {
    border: 1px solid rgba(220, 50, 50, .25);
    background: transparent;
    color: #c0392b;
}

.firma-btn--clear:hover {
    background: rgba(220, 50, 50, .06);
}

.firma-btn--upload {
    border: 1px solid var(--border-input);
    background: transparent;
    color: var(--text-secondary);
}

.firma-btn--upload:hover {
    background: var(--green-xlight);
    border-color: var(--green);
    color: var(--green);
}

/* ── NAV BUTTONS ────────────────────────────────── */
.form-nav {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--tr);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.nav-btn--prev {
    border: 1.5px solid var(--border-input);
    background: transparent;
    color: var(--text-secondary);
}

.nav-btn--prev:hover:not(:disabled) {
    border-color: var(--green);
    color: var(--green);
}

.nav-btn--prev:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.nav-btn--next {
    flex: 1;
    background: var(--green);
    border: none;
    color: #fff;
    box-shadow: 0 4px 16px rgba(12, 144, 60, .28);
}

.nav-btn--next:hover {
    background: var(--green-dark);
}

.nav-btn--next:active {
    transform: scale(.98);
}

.nav-btn--submit {
    flex: 1;
    background: var(--green);
    border: none;
    color: #fff;
    box-shadow: 0 4px 16px rgba(12, 144, 60, .28);
}

.nav-btn--submit:hover {
    background: var(--green-dark);
}

.nav-btn--submit:active {
    transform: scale(.98);
}

/* ── MODAL CONSULTA ─────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 24, 12, .5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--white);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
    animation: modalIn .28s cubic-bezier(.34, 1.4, .64, 1) both;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.92) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--off-white);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--tr);
}

.modal-close svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.modal-close:hover {
    background: #f0f0f0;
}

.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 4px 16px rgba(12, 144, 60, .28);
    transition: background var(--tr);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
    .page-wrap {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        border-radius: 0 0 28px 28px;
    }

    .left-inner {
        padding: 28px 24px;
        gap: 20px;
    }

    .stepper {
        display: none;
    }

    .right-panel {
        width: 100%;
    }

    .right-inner {
        padding: 32px 24px 48px;
    }
}

@media (max-width: 560px) {
    .motivo-section {
        grid-template-columns: 1fr;
    }

    .fields-row {
        grid-template-columns: 1fr;
    }

    .right-inner {
        padding: 24px 18px 40px;
    }
}