*{
    box-sizing:border-box;
}

html,body{
    margin:0;
    min-height:100%;
    font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
}

body{
    min-height:100vh;
    background:
        radial-gradient(circle at 50% -10%, rgba(31,104,188,.20), transparent 38%),
        linear-gradient(145deg,#080f1d 0%,#111b2c 52%,#080f1c 100%);
}

/* =========================================================
   PANTALLA DE NOMBRE
   SIEMPRE CENTRADA
========================================================= */
.welcome-page{
    min-height:100vh;
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.welcome-card{
    width:min(430px,100%);
    padding:44px 32px;
    text-align:center;
    background:#fff;
    border-radius:24px;
    box-shadow:0 28px 80px rgba(0,0,0,.38);
}

.welcome-mic{
    font-size:58px;
}

.welcome-card h1{
    margin:12px 0 7px;
    color:#102039;
    font-size:27px;
}

.welcome-card p{
    margin:0 0 25px;
    color:#718198;
}

.welcome-card input{
    width:100%;
    height:50px;
    padding:0 15px;
    border:1px solid #d1dce8;
    border-radius:13px;
    outline:none;
    font-size:16px;
}

.welcome-card input:focus{
    border-color:#238ff0;
    box-shadow:0 0 0 3px rgba(35,143,240,.10);
}

.welcome-card button{
    width:100%;
    height:50px;
    margin-top:10px;
    border:0;
    border-radius:13px;
    background:linear-gradient(135deg,#168ff5,#2872e9);
    color:#fff;
    font-weight:750;
    font-size:16px;
    cursor:pointer;
}

/* =========================================================
   CHAT COMO SECCIÓN GRANDE DE LA WEB
   CENTRADO, NO FLOTANTE
========================================================= */
.page{
    width:100%;
    min-height:100vh;
    padding:42px 28px;
    display:flex;
    justify-content:center;
    align-items:flex-start;
}

.chat-window{
    width:min(1100px,100%);
    overflow:hidden;
    border:1px solid rgba(90,173,255,.72);
    border-radius:28px;
    background:#fff;
    box-shadow:0 30px 90px rgba(0,0,0,.42);
}

/* HEADER */
.chat-header{
    min-height:126px;
    padding:21px 27px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    color:#fff;
    position:relative;
    overflow:hidden;
    background:linear-gradient(135deg,#07172e 0%,#0b2346 55%,#06152d 100%);
}

.chat-header:after{
    content:"";
    position:absolute;
    width:180px;
    height:55px;
    right:190px;
    bottom:12px;
    opacity:.38;
    background:repeating-linear-gradient(
        90deg,
        transparent 0 6px,
        #238df0 7px 9px,
        transparent 10px 15px
    );
    clip-path:polygon(
        0 75%,5% 50%,10% 72%,15% 24%,20% 70%,
        25% 8%,30% 74%,35% 30%,40% 68%,45% 0,
        50% 72%,55% 25%,60% 78%,65% 15%,70% 70%,
        75% 35%,80% 76%,85% 20%,90% 73%,95% 45%,
        100% 76%,100% 100%,0 100%
    );
}

.brand{
    display:flex;
    align-items:center;
    gap:15px;
    position:relative;
    z-index:1;
}

.brand-icon{
    font-size:43px;
    filter:drop-shadow(0 4px 10px rgba(30,155,255,.35));
}

.chat-title{
    font-size:27px;
    font-weight:850;
    letter-spacing:-.7px;
}

.chat-title span{
    color:#27a9ff;
}

.chat-subtitle{
    margin-top:4px;
    color:#b6c9df;
    font-size:14px;
}

.header-actions{
    display:flex;
    align-items:center;
    gap:9px;
    position:relative;
    z-index:2;
}

.online-pill{
    display:flex;
    align-items:center;
    gap:7px;
    white-space:nowrap;
    padding:11px 16px;
    border:1px solid rgba(69,166,255,.42);
    border-radius:23px;
    background:rgba(1,18,39,.72);
    color:#e9f4ff;
    font-size:13px;
}

.online-pill i{
    width:10px;
    height:10px;
    border-radius:50%;
    background:#1de184;
    box-shadow:0 0 12px rgba(29,225,132,.75);
}

.header-btn{
    width:40px;
    height:40px;
    border:1px solid rgba(255,255,255,.18);
    border-radius:50%;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:25px;
    line-height:1;
    cursor:pointer;
}

/* MENSAJES */
.messages{
    height:570px;
    overflow-y:auto;
    padding:25px 38px 38px;
    background:
        radial-gradient(circle at 15% 20%,rgba(35,143,240,.025),transparent 25%),
        #f7fbff;
    scrollbar-width:thin;
}

.date-divider{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
    margin:0 auto 28px;
    color:#7890aa;
    font-size:12px;
}

.date-divider:before,
.date-divider:after{
    content:"";
    height:1px;
    background:#dce7f1;
    flex:1;
}

.date-divider span{
    padding:7px 16px;
    border-radius:20px;
    background:#eaf2fa;
    white-space:nowrap;
}

.message-row{
    display:flex;
    align-items:flex-start;
    gap:11px;
    max-width:72%;
    margin-bottom:23px;
    animation:messageIn .18s ease-out;
}

.message-row.mine{
    margin-left:auto;
    flex-direction:row-reverse;
    text-align:right;
}

@keyframes messageIn{
    from{opacity:0;transform:translateY(5px)}
    to{opacity:1;transform:translateY(0)}
}

.avatar{
    position:relative;
    flex:0 0 44px;
    width:44px;
    height:44px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:18px;
    font-weight:800;
    background:linear-gradient(135deg,#18a9ff,#6936ef);
    box-shadow:0 5px 15px rgba(35,131,232,.22);
}

.other .avatar:after{
    content:"";
    position:absolute;
    right:-1px;
    bottom:-1px;
    width:11px;
    height:11px;
    border:2px solid #f7fbff;
    border-radius:50%;
    background:#17d57d;
}

.message-content{
    min-width:0;
}

.message-name{
    margin:0 7px 6px;
    color:#14253b;
    font-size:13px;
    font-weight:800;
}

.bubble{
    display:inline-block;
    max-width:100%;
    padding:11px 15px;
    border:1px solid #e0e9f2;
    border-radius:17px;
    background:#fff;
    color:#142033;
    box-shadow:0 4px 15px rgba(32,70,105,.06);
    font-size:16px;
    line-height:1.42;
    text-align:left;
    word-break:break-word;
}

.other .bubble{
    border-bottom-left-radius:5px;
}

.mine .bubble{
    color:#fff;
    border-color:#218ff0;
    border-bottom-right-radius:5px;
    background:linear-gradient(135deg,#128ef2,#2c73e9);
}

.message-meta{
    margin:5px 7px 0;
    color:#8a9db1;
    font-size:10px;
}

/* FOOTER */
.chat-footer{
    padding:14px 18px 13px;
    border-top:1px solid #dfe8f1;
    background:#fff;
}

.composer{
    display:flex;
    align-items:center;
    gap:10px;
}

.emoji-btn{
    width:49px;
    height:49px;
    flex:0 0 49px;
    border:1px solid #dce7f1;
    border-radius:50%;
    background:#fff;
    color:#61768c;
    font-size:27px;
    cursor:pointer;
}

.input-wrap{
    min-width:0;
    flex:1;
    height:52px;
    display:flex;
    align-items:center;
    padding-left:17px;
    border:1px solid #ccdae7;
    border-radius:18px;
    background:#fff;
}

.input-wrap input{
    min-width:0;
    flex:1;
    height:100%;
    border:0;
    outline:0;
    background:transparent;
    color:#142033;
    font-size:16px;
}

.input-wrap input::placeholder{
    color:#8fa1b3;
}

.input-actions{
    display:flex;
    gap:2px;
    padding-right:8px;
}

.input-actions button{
    width:31px;
    height:35px;
    border:0;
    background:transparent;
    color:#6d8298;
    font-size:20px;
    cursor:pointer;
}

.send-btn{
    width:54px;
    height:54px;
    flex:0 0 54px;
    border:0;
    border-radius:50%;
    background:linear-gradient(135deg,#168ff5,#2d70e9);
    color:#fff;
    font-size:26px;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(35,124,235,.28);
}

.send-btn:disabled{
    opacity:.6;
    cursor:default;
}

.quick-row{
    display:flex;
    align-items:center;
    gap:10px;
    width:max-content;
    max-width:100%;
    margin:11px 0 0 59px;
    padding:7px 13px;
    border:1px solid #cfe3f5;
    border-radius:24px;
    background:#f0f8ff;
}

.quick-row button{
    padding:0;
    border:0;
    background:transparent;
    font-size:21px;
    cursor:pointer;
}

.quick-row .more{
    color:#627a93;
    font-size:25px;
}

.footer-note{
    margin:-25px 4px 0;
    text-align:right;
    color:#87a0b8;
    font-size:12px;
    font-style:italic;
}

.footer-note span{
    font-size:18px;
}

/* =========================================================
   MÓVIL
========================================================= */
@media(max-width:760px){
    .page{
        padding:0;
        min-height:100vh;
    }

    .chat-window{
        width:100%;
        min-height:100vh;
        border-radius:0;
        border:0;
    }

    .chat-header{
        min-height:92px;
        padding:14px;
    }

    .brand-icon{
        font-size:31px;
    }

    .chat-title{
        font-size:19px;
    }

    .chat-subtitle{
        font-size:12px;
    }

    .online-pill{
        padding:8px 10px;
        font-size:11px;
    }

    .header-btn{
        width:34px;
        height:34px;
        font-size:21px;
    }

    .header-actions{
        gap:5px;
    }

    .messages{
        height:calc(100vh - 235px);
        min-height:390px;
        padding:18px 13px 25px;
    }

    .message-row{
        max-width:88%;
    }

    .avatar{
        width:37px;
        height:37px;
        flex-basis:37px;
        font-size:15px;
    }

    .emoji-btn{
        display:none;
    }

    .quick-row{
        margin-left:0;
        overflow:hidden;
    }

    .footer-note{
        display:none;
    }
}
