:root {

    --primary:
        #0A9396;

    --primary-dark:
        #005f73;

    --background:
        #f5f7f8;

    --text:
        #1f2933;

    --muted:
        #6b7280;

    --border:
        #e2e8f0;

}


/* =========================
   RESET
========================= */

* {

    box-sizing:
        border-box;

    -webkit-tap-highlight-color:
        transparent;

}


html,
body {

    width:
        100%;

    height:
        100%;

    margin:
        0;

    padding:
        0;

    overflow:
        hidden;

}


body {

    font-family:

        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background:
        var(--background);

    color:
        var(--text);

}


/* =========================
   APP
========================= */

.app {

    width:
        100%;

    height:
        100vh;

    height:
        100dvh;

    display:
        flex;

    flex-direction:
        column;

    overflow:
        hidden;

    background:
        var(--background);

}


/* =========================
   HEADER
========================= */

.header {

    width:
        100%;

    min-height:
        74px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    padding:
        12px
        18px;

    background:
        white;

    border-bottom:
        1px solid
        var(--border);

    flex:
        0 0 auto;

    z-index:
        20;

}


.brand {

    display:
        flex;

    align-items:
        center;

    gap:
        12px;

    min-width:
        0;

}


.brand-logo {

    width:
        46px;

    height:
        46px;

    flex-shrink:
        0;

}


.brand-logo img {

    width:
        100%;

    height:
        100%;

    object-fit:
        contain;

    border-radius:
        12px;

}


.brand-text {

    display:
        flex;

    flex-direction:
        column;

    gap:
        3px;

    min-width:
        0;

}


.brand-text strong {

    font-size:
        15px;

    color:
        var(--text);

    white-space:
        nowrap;

}


.brand-text span {

    font-size:
        12px;

    color:
        var(--muted);

    white-space:
        nowrap;

}


/* =========================
   ACCIONES HEADER
========================= */

.header-actions {

    display:
        flex;

    align-items:
        center;

    gap:
        8px;

}


.back-btn {

    height:
        42px;

    padding:
        0
        14px;

    border:
        1px solid
        rgba(
            10,
            147,
            150,
            .18
        );

    border-radius:
        12px;

    background:
        rgba(
            10,
            147,
            150,
            .08
        );

    color:
        var(--primary-dark);

    text-decoration:
        none;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        8px;

    font-size:
        14px;

    font-weight:
        600;

    cursor:
        pointer;

}


.back-btn:active {

    transform:
        scale(.96);

}


/* =========================
   CHAT
========================= */

.chat-messages {

    flex:
        1 1 auto;

    min-height:
        0;

    overflow-y:
        auto;

    overflow-x:
        hidden;

    display:
        flex;

    flex-direction:
        column;

    gap:
        14px;

    padding:
        24px
        18px;

    overscroll-behavior:
        contain;

    -webkit-overflow-scrolling:
        touch;

}


/* =========================
   BIENVENIDA
========================= */

.welcome {

    width:
        100%;

    max-width:
        440px;

    margin:
        auto;

    text-align:
        center;

    animation:
        fadeIn
        .4s
        ease;

}


.welcome-icon {

    width:
        80px;

    height:
        80px;

    margin:
        0 auto
        20px;

    border-radius:
        24px;

    background:
        linear-gradient(
            135deg,
            #0A9396,
            #005f73
        );

    color:
        white;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    font-size:
        34px;

    box-shadow:
        0 10px 30px
        rgba(
            10,
            147,
            150,
            .25
        );

}


.welcome h1 {

    font-size:
        25px;

    color:
        var(--text);

    margin:
        0
        0
        10px;

}


.welcome p {

    color:
        var(--muted);

    line-height:
        1.6;

    margin:
        0
        0
        25px;

}


.start-btn {

    width:
        100%;

    border:
        none;

    background:
        var(--primary);

    color:
        white;

    padding:
        16px;

    border-radius:
        14px;

    font-size:
        16px;

    font-weight:
        600;

    cursor:
        pointer;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        10px;

    box-shadow:
        0 8px 20px
        rgba(
            10,
            147,
            150,
            .25
        );

}


.start-btn:active {

    transform:
        scale(.98);

}


/* =========================
   MENSAJES CHAT
========================= */

.chat-message {

    display:
        flex;

    gap:
        8px;

    align-items:
        flex-end;

    max-width:
        92%;

    animation:
        messageIn
        .25s
        ease;

}


.chat-message.bot {

    align-self:
        flex-start;

}


.chat-message.user {

    align-self:
        flex-end;

    margin-left:
        auto;

}


.message-logo {

    width:
        32px;

    height:
        32px;

    flex-shrink:
        0;

}


.message-logo img {

    width:
        100%;

    height:
        100%;

    object-fit:
        contain;

    border-radius:
        50%;

    background:
        white;

}


/* =========================
   CONTENIDO MENSAJE
========================= */

.message-content {

    background:
        white;

    color:
        var(--text);

    padding:
        12px
        14px;

    border-radius:
        16px;

    border-bottom-left-radius:
        4px;

    font-size:
        15px;

    line-height:
        1.5;

    box-shadow:
        0 2px 8px
        rgba(
            0,
            0,
            0,
            .08
        );

    word-break:
        break-word;

    pointer-events:
        auto;

}


.chat-message.user
.message-content {

    background:
        #dcf8c6;

    border-bottom-left-radius:
        16px;

    border-bottom-right-radius:
        4px;

}


/* =========================
   LINKS CHAT
========================= */

.message-content a,
.message-content a.chat-link {

    color:
        var(--primary-dark) !important;

    font-weight:
        600;

    text-decoration:
        underline !important;

    word-break:
        break-all;

    cursor:
        pointer !important;

    pointer-events:
        auto !important;

    position:
        relative;

    z-index:
        100;

    touch-action:
        manipulation;

    -webkit-user-select:
        text;

    user-select:
        text;

}


.message-content
a.chat-link:active {

    opacity:
        .65;

}


/* =========================
   TELÉFONO
========================= */

.phone-box {

    margin-top:
        14px;

    padding:
        12px;

    background:
        #f7f9fa;

    border-radius:
        12px;

}


.phone-box label {

    display:
        block;

    font-size:
        12px;

    color:
        #607d8b;

    margin-bottom:
        8px;

}


.phone-box input {

    width:
        100%;

    border:
        none;

    border-bottom:
        2px solid
        #ddd;

    background:
        transparent;

    padding:
        10px
        4px;

    font-size:
        16px;

    outline:
        none;

}


.phone-box input:focus {

    border-color:
        var(--primary);

}


.phone-submit {

    width:
        100%;

    margin-top:
        12px;

    border:
        none;

    background:
        var(--primary);

    color:
        white;

    padding:
        12px;

    border-radius:
        10px;

    font-weight:
        600;

    font-size:
        15px;

    cursor:
        pointer;

}


.phone-submit:active {

    transform:
        scale(.98);

}


/* =========================
   OPCIONES
========================= */

.options-title {

    margin-bottom:
        10px;

    font-weight:
        600;

}


.turnos-options {

    display:
        flex;

    flex-direction:
        column;

    gap:
        7px;

    max-height:
        350px;

    overflow-y:
        auto;

    padding-right:
        3px;

}


.turnos-option {

    width:
        100%;

    text-align:
        left;

    border:
        1px solid
        #e4e8eb;

    background:
        white;

    padding:
        12px;

    border-radius:
        10px;

    cursor:
        pointer;

    color:
        #075e54;

    font-size:
        14px;

    transition:
        background .2s,
        border-color .2s;

}


.turnos-option:hover {

    background:
        #f0fafa;

    border-color:
        var(--primary);

}


.turnos-option:active {

    background:
        #e8f7f7;

}


.turnos-option:disabled {

    opacity:
        .5;

    cursor:
        default;

}


/* =========================
   TYPING
========================= */

.typing-dots {

    display:
        flex;

    gap:
        5px;

    padding:
        4px
        2px;

}


.typing-dots span {

    width:
        7px;

    height:
        7px;

    border-radius:
        50%;

    background:
        #90a4ae;

    animation:
        typingAnimation
        1.2s
        infinite;

}


.typing-dots span:nth-child(2) {

    animation-delay:
        .2s;

}


.typing-dots span:nth-child(3) {

    animation-delay:
        .4s;

}


/* =========================
   BARRA INFERIOR
========================= */

.chat-input-container {

    width:
        100%;

    margin:
        0;

    background:
        white;

    border-top:
        1px solid
        var(--border);

    flex:
        0 0 auto;

    position:
        relative;

    z-index:
        20;

    padding:
        10px
        12px
        calc(
            10px +
            env(safe-area-inset-bottom)
        );

}


.chat-input-wrapper {

    width:
        100%;

    display:
        flex;

    align-items:
        center;

    gap:
        10px;

}


#chatInput {

    flex:
        1;

    width:
        100%;

    min-width:
        0;

    height:
        54px;

    border:
        1px solid
        var(--border);

    border-radius:
        14px;

    padding:
        0
        16px;

    font-size:
        16px;

    color:
        var(--text);

    background:
        white;

    outline:
        none;

}


#chatInput:focus {

    border-color:
        var(--primary);

}


#chatInput::placeholder {

    color:
        #94a3b8;

}


/* =========================
   BOTÓN ENVIAR
========================= */

.send-btn {

    width:
        54px;

    min-width:
        54px;

    height:
        54px;

    border:
        none;

    border-radius:
        14px;

    background:
        var(--primary);

    color:
        white;

    cursor:
        pointer;

    font-size:
        18px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    flex-shrink:
        0;

}


.send-btn:active {

    transform:
        scale(.95);

    background:
        var(--primary-dark);

}


/* =========================
   ANIMACIONES
========================= */

@keyframes typingAnimation {

    0%,
    60%,
    100% {

        transform:
            translateY(0);

    }


    30% {

        transform:
            translateY(-5px);

    }

}


@keyframes messageIn {

    from {

        opacity:
            0;

        transform:
            translateY(8px);

    }


    to {

        opacity:
            1;

        transform:
            translateY(0);

    }

}


@keyframes fadeIn {

    from {

        opacity:
            0;

        transform:
            scale(.97);

    }


    to {

        opacity:
            1;

        transform:
            scale(1);

    }

}


/* =========================
   SCROLLBAR
========================= */

.chat-messages::-webkit-scrollbar {

    width:
        4px;

}


.chat-messages::-webkit-scrollbar-thumb {

    background:
        rgba(
            0,
            0,
            0,
            .18
        );

    border-radius:
        10px;

}


/* =========================
   MÓVIL
========================= */

@media (max-width: 480px) {

    .app {

        width:
            100%;

        height:
            100vh;

        height:
            100dvh;

        min-height:
            0;

        padding-bottom:
            max(
                28px,
                env(safe-area-inset-bottom)
            );

    }


    .header {

        min-height:
            68px;

        padding-left:
            12px;

        padding-right:
            12px;

    }


    .brand {

        gap:
            8px;

    }


    .brand-logo {

        width:
            40px;

        height:
            40px;

    }


    .brand-text strong {

        font-size:
            13px;

    }


    .brand-text span {

        font-size:
            11px;

    }


    .header-actions {

        gap:
            6px;

    }


    .back-btn {

        width:
            42px;

        min-width:
            42px;

        height:
            42px;

        padding:
            0;

        border-radius:
            12px;

    }


    .back-btn span {

        display:
            none;

    }


    .back-btn i {

        font-size:
            17px;

    }


    .chat-messages {

        padding:
            16px
            12px;

    }


    .welcome {

        max-width:
            100%;

    }


    .welcome h1 {

        font-size:
            23px;

    }


    .welcome-icon {

        width:
            72px;

        height:
            72px;

        font-size:
            30px;

    }


    .chat-message {

        max-width:
            96%;

    }


    .chat-input-container {

        padding:
            10px
            10px
            12px;

    }


    #chatInput {

        height:
            52px;

    }


    .send-btn {

        width:
            52px;

        min-width:
            52px;

        height:
            52px;

    }

}


/* =========================
   DESKTOP
========================= */

@media (min-width: 768px) {

    body {

        background:
            #e9eef0;

    }


    .app {

        max-width:
            650px;

        margin:
            0 auto;

        background:
            var(--background);

        box-shadow:
            0 0 40px
            rgba(
                0,
                0,
                0,
                .10
            );

    }

}
/* =========================
   BOTONES DE ENLACES
========================= */

.chat-url-button {

    width:
        100%;

    margin-top:
        12px;

    padding:
        13px 16px;

    border:
        none;

    border-radius:
        12px;

    background:
        #0A9396;

    color:
        white;

    font-size:
        14px;

    font-weight:
        600;

    font-family:
        inherit;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        9px;

    cursor:
        pointer;

    pointer-events:
        auto !important;

    touch-action:
        manipulation;

    -webkit-tap-highlight-color:
        transparent;

    position:
        relative;

    z-index:
        9999;

    transition:
        transform .15s ease,
        opacity .15s ease;

}


.chat-url-button:active {

    transform:
        scale(.97);

    opacity:
        .85;

}


.chat-url-button i {

    pointer-events:
        none;

}
/* =========================
   LISTA DE OPCIONES
========================= */

.turnos-options {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 3px;
}

/* =========================
   BOTÓN OPCIÓN
========================= */

.turnos-option {
    width: 100%;
    min-height: 56px;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    gap: 12px;
    padding: 12px 14px;

    box-sizing: border-box;

    background: #ffffff;

    border: 2px solid rgba(10, 147, 150, .28);
    border-radius: 14px;

    color: #075e54;

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;

    cursor: pointer;
    text-decoration: none;

    box-shadow: 0 3px 10px rgba(0, 0, 0, .07);

    transition:
        transform .15s ease,
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.turnos-option > span:first-child {
    flex: 1;
    min-width: 0;
}

/* =========================
   FLECHA PERFECTAMENTE CENTRADA
========================= */

.turnos-option .option-arrow {
    width: 30px;
    height: 30px;
    min-width: 30px;
    flex: 0 0 30px;

    margin-left: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--primary);
    color: #ffffff;

    font-size: 22px;
    font-weight: 600;
    line-height: 1;

    padding: 0;
    text-align: center;

    box-shadow: 0 2px 6px rgba(10, 147, 150, .25);
}

/* =========================
   LINK COMO OPCIÓN
========================= */

.turnos-option.link-option {
    justify-content: space-between;

    background: var(--primary);
    border-color: var(--primary);

    color: #ffffff;

    box-shadow:
        0 4px 12px rgba(10, 147, 150, .25);
}

.turnos-option.link-option span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.turnos-option.link-option i {
    font-size: 15px;
    opacity: .95;
}

/* =========================
   HOVER
========================= */

.turnos-option:hover {
    background: #f0fafa;
    border-color: var(--primary);

    box-shadow:
        0 5px 14px rgba(10, 147, 150, .15);

    transform: translateY(-1px);
}

.turnos-option.link-option:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* =========================
   ACTIVE
========================= */

.turnos-option:active {
    transform: scale(.97);

    box-shadow:
        0 2px 5px rgba(0, 0, 0, .08);
}

.turnos-option:active .option-arrow {
    transform: scale(.92);
}

/* =========================
   DESHABILITADO
========================= */

.turnos-option:disabled {
    opacity: .5;
    cursor: default;
    transform: none;
}

/* =========================
   MÓVIL
========================= */

@media (max-width: 480px) {

    .turnos-options {
        gap: 10px;
    }

    .turnos-option {
        min-height: 58px;
        padding: 13px 14px;
        border-radius: 14px;
        font-size: 15px;
    }

    .turnos-option .option-arrow {
        width: 32px;
        height: 32px;
        min-width: 32px;
        flex-basis: 32px;
        font-size: 23px;
    }
}
/* Flecha de los botones: solo visible en móviles */
.turnos-option .option-arrow {
    display: none;
}

@media (max-width: 768px) {
    .turnos-option .option-arrow {
        display: flex;
        width: 30px;
        height: 30px;
        min-width: 30px;
        flex: 0 0 30px;
        margin-left: auto;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--primary);
        color: #fff;
        font-size: 22px;
        font-weight: 600;
        line-height: 1;
        padding: 0;
        text-align: center;
        box-shadow: 0 2px 6px rgba(10,147,150,.25);
    }
}