/* =========================================
   ASISTENTE FLOTANTE DE ROBOTS
========================================= */

.segman-robot-assistant {
    --sra-navy: #041F3A;
    --sra-blue: #0874B9;
    --sra-cyan: #28B9F0;
    --sra-text: #17212B;
    --sra-muted: #64717C;

    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 9999;
    font-family: Arial, Helvetica, sans-serif;
}

/* Botón flotante */

.segman-robot-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    padding: 13px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: linear-gradient(145deg, #0874B9, #041F3A);
    box-shadow: 0 8px 25px rgba(4, 31, 58, 0.28);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.segman-robot-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(4, 31, 58, 0.35);
}

.segman-robot-trigger svg,
.segman-robot-avatar svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.segman-robot-trigger .robot-eye,
.segman-robot-avatar .robot-eye {
    fill: #28B9F0;
    stroke: #28B9F0;
}

/* Indicador de notificación */

.segman-robot-notification {
    position: absolute;
    top: 2px;
    right: 1px;
    width: 13px;
    height: 13px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #28B9F0;
}

/* Globito de bienvenida */

.segman-robot-bubble {
    position: absolute;
    right: 0;
    bottom: 82px;
    width: 290px;
    box-sizing: border-box;
    padding: 20px;
    padding-right: 30px;
    border: 1px solid #E2E7EB;
    border-radius: 15px;
    background: #ffffff;
    color: var(--sra-text);
    box-shadow: 0 8px 30px rgba(4, 31, 58, 0.15);
    animation: sra-appear 0.3s ease;
}

.segman-robot-bubble::after {
    content: "";
    position: absolute;
    right: 24px;
    bottom: -8px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-right: 1px solid #E2E7EB;
    border-bottom: 1px solid #E2E7EB;
    transform: rotate(45deg);
}

.segman-robot-bubble strong {
    display: block;
    margin-bottom: 7px;
    font-size: 16px;
    line-height: 1.4;
    color: var(--sra-navy);
}

.segman-robot-bubble p {
    margin: 0 0 13px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--sra-muted);
}

.segman-robot-bubble-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sra-blue);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.segman-robot-bubble-link span {
    margin-left: 4px;
}

.segman-robot-bubble-close {
    position: absolute;
    top: 7px;
    right: 9px;
    padding: 2px 5px;
    border: 0;
    background: transparent;
    color: #64717C;
    font-size: 22px;
    cursor: pointer;
}

/* Ventana de opciones */

.segman-robot-panel {
    position: absolute;
    right: 0;
    bottom: 82px;
    width: 350px;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    border: 1px solid #E2E7EB;
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(4, 31, 58, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease,
                visibility 0.22s ease;
}

.segman-robot-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.segman-robot-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 19px;
    background: linear-gradient(120deg, #041F3A, #063557);
    color: #ffffff;
}

.segman-robot-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.segman-robot-heading {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
}

.segman-robot-heading strong {
    font-size: 15px;
}

.segman-robot-heading span {
    color: #C7D9E8;
    font-size: 12px;
}

.segman-robot-close {
    align-self: flex-start;
    padding: 0 3px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
}

.segman-robot-panel-content {
    padding: 19px;
}

.segman-robot-panel-content > p {
    margin: 0 0 15px;
    color: var(--sra-text);
    font-size: 14px;
    line-height: 1.55;
}

/* Opciones */

.segman-robot-option {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 9px;
    padding: 13px 10px;
    border: 1px solid #E2E7EB;
    border-radius: 10px;
    background: #ffffff;
    color: var(--sra-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.segman-robot-option:hover {
    border-color: var(--sra-blue);
    background: #F2F8FC;
}

.segman-robot-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #EAF4FA;
    color: var(--sra-blue);
    font-size: 20px;
    font-weight: 700;
}

.segman-robot-option > span:nth-child(2) {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
}

.segman-robot-option strong {
    font-size: 13px;
    line-height: 1.35;
}

.segman-robot-option small {
    color: var(--sra-muted);
    font-size: 11px;
    line-height: 1.4;
}

.segman-robot-arrow {
    color: var(--sra-blue);
    font-size: 23px;
}

.segman-robot-panel-footer {
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid #E2E7EB;
    color: var(--sra-muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.segman-robot-option {
    cursor: default;
}

.segman-robot-option:hover {
    border-color: #E2E7EB;
    background: #ffffff;
}

.segman-robot-bubble {
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
}

.segman-robot-bubble[hidden] {
    display: none !important;
}

@keyframes sra-appear {
    from {
        opacity: 0;
        transform: translateY(7px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Adaptación a móviles */

@media (max-width: 600px) {
    .segman-robot-assistant {
        right: 16px;
        bottom: 18px;
    }

    .segman-robot-trigger {
        width: 58px;
        height: 58px;
        padding: 11px;
    }

    .segman-robot-bubble {
        right: 0;
        bottom: 72px;
        width: min(290px, calc(100vw - 32px));
    }

    .segman-robot-panel {
        right: 0;
        bottom: 72px;
        width: min(350px, calc(100vw - 32px));
        max-height: calc(100dvh - 110px);
        overflow-y: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .segman-robot-trigger,
    .segman-robot-panel {
        transition: none;
    }

    .segman-robot-bubble {
        animation: none;
    }
}







/* =========================================
   FORMULARIO MODAL
========================================= */

.segman-robot-panel-content {
    max-height: min(72vh, 650px);
    overflow-y: auto;
}

.segman-form-progress {
    margin-bottom: 22px;
}

.segman-form-progress-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
    color: #0874B9;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
}

.segman-form-progress-label span:last-child {
    color: #64717C;
    font-weight: 400;
    letter-spacing: 0;
}

.segman-form-progress-track {
    height: 4px;
    overflow: hidden;
    border-radius: 10px;
    background: #E2E7EB;
}

#segmanStepBar {
    width: 50%;
    height: 100%;
    border-radius: inherit;
    background: #0874B9;
    transition: width .25s ease;
}

.segman-form-step[hidden] {
    display: none !important;
}

.segman-form-step h3 {
    margin: 0 0 7px;
    color: #041F3A;
    font-size: 22px;
    line-height: 1.3;
}

.segman-form-intro {
    margin: 0 0 19px;
    color: #64717C;
    font-size: 13px;
    line-height: 1.55;
}

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

.segman-form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    margin-bottom: 16px;
}

.segman-field-full {
    grid-column: 1 / -1;
}

.segman-form-field label,
.segman-form-field legend {
    color: #17212B;
    font-size: 12px;
    font-weight: 600;
}

.segman-form-field label span {
    color: #64717C;
    font-weight: 400;
}

.segman-form-field input,
.segman-form-field select,
.segman-form-field textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #D9E0E6;
    border-radius: 7px;
    outline: none;
    background: #FFFFFF;
    color: #17212B;
    font: inherit;
    font-size: 13px;
}

.segman-form-field input:focus,
.segman-form-field select:focus,
.segman-form-field textarea:focus {
    border-color: #0874B9;
    box-shadow: 0 0 0 3px rgba(8, 116, 185, .1);
}

.segman-form-field textarea {
    resize: vertical;
}

.segman-modality {
    padding: 0;
    border: 0;
}

.segman-modality legend {
    margin-bottom: 10px;
}

.segman-modality-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.segman-modality-options label {
    position: relative;
    cursor: pointer;
}

.segman-modality-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.segman-modality-options label span {
    display: block;
    padding: 11px 8px;
    border: 1px solid #D9E0E6;
    border-radius: 7px;
    color: #17212B;
    font-size: 12px;
    text-align: center;
    transition: .2s ease;
}

.segman-modality-options input:checked + span {
    border-color: #0874B9;
    background: #EAF4FA;
    color: #063557;
    font-weight: 700;
}

.segman-modality-options input:focus-visible + span {
    outline: 2px solid #0874B9;
    outline-offset: 2px;
}

.segman-privacy {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 4px 0 18px;
    color: #64717C;
    font-size: 11px;
    line-height: 1.5;
}

.segman-privacy input {
    margin-top: 2px;
    flex-shrink: 0;
}

.segman-privacy a {
    color: #0874B9;
    text-decoration: underline;
}

.segman-form-next,
.segman-form-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 43px;
    padding: 12px 16px;
    border: 0;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.segman-form-next {
    width: 100%;
    background: #0874B9;
    color: #FFFFFF;
}

.segman-form-next:hover {
    background: #063557;
}

.segman-form-back {
    flex-shrink: 0;
    border: 1px solid #D9E0E6;
    background: #FFFFFF;
    color: #041F3A;
}

.segman-form-actions {
    display: flex;
    gap: 10px;
}

.segman-form-actions .segman-form-next {
    flex: 1;
}

@media (max-width: 600px) {
    .segman-robot-panel-content {
        max-height: calc(100dvh - 190px);
    }

    .segman-form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .segman-field-full {
        grid-column: auto;
    }

    .segman-form-step h3 {
        font-size: 20px;
    }
}

