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

:root {
    --ocean-deep: #050508;
    --ocean-mid: #0D1B2A;
    --ocean-blue: #3B82F6;
    --ocean-violet: #8B5CF6;
    --ocean-pale: #B8C9E0;
    --ocean-foam: #D4E4F7;
    --coral: #E8836B;
    --pink: #F4978E;
    --gto-oro: #FFD100;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--ocean-deep);
    color: var(--ocean-foam);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* ---- Orbes de fondo ---- */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .35;
    pointer-events: none;
}
.orb-blue   { width: 420px; height: 420px; background: var(--ocean-blue); top: -120px; left: -100px; animation: float 9s ease-in-out infinite; }
.orb-violet { width: 380px; height: 380px; background: var(--ocean-violet); bottom: -120px; right: -80px; animation: float 11s ease-in-out infinite reverse; }
.orb-coral  { width: 260px; height: 260px; background: var(--coral); top: 55%; left: 60%; opacity: .16; animation: float 13s ease-in-out infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-24px); }
}

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

.animate-fade-in-up { animation: fadeInUp .7s ease both; }
.animate-float { animation: float 6s ease-in-out infinite; }

/* ---- Contenedor glass ---- */
.chat-container {
    width: 100%;
    max-width: 720px;
    height: 92vh;
    background: rgba(13, 27, 42, .55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(59, 130, 246, .18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---- Header ---- */
.chat-header {
    background: linear-gradient(135deg, rgba(5,5,8,.85), rgba(13,27,42,.65));
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: 18px 22px;
}

.header-info { display: flex; align-items: center; gap: 15px; }

.logo-gto {
    width: 62px;
    height: 62px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 14px rgba(59, 130, 246, .45));
}

.header-text h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .3px;
}

.grad-text {
    background: linear-gradient(90deg, var(--ocean-blue), var(--ocean-violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    display: block;
    font-size: .74rem;
    color: var(--ocean-pale);
    margin-top: 2px;
    letter-spacing: .3px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    margin-top: 7px;
    color: var(--ocean-foam);
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 3px 11px;
    border-radius: 999px;
}

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #43E97B;
    box-shadow: 0 0 8px #43E97B;
    animation: pulseSlow 2s infinite;
}

@keyframes pulseSlow { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ---- Mensajes ---- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background:
        radial-gradient(circle at 15% 10%, rgba(59,130,246,.07) 0, transparent 30%),
        radial-gradient(circle at 85% 90%, rgba(139,92,246,.06) 0, transparent 32%);
}

.message {
    display: flex;
    gap: 10px;
    max-width: 86%;
    animation: fadeInUp .35s ease both;
}

.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.message-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--ocean-blue), var(--ocean-violet));
    box-shadow: 0 4px 14px rgba(59, 130, 246, .35);
}

.message.user .message-avatar { background: linear-gradient(135deg, var(--coral), var(--pink)); }

.message-content {
    padding: 13px 17px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: .93rem;
    overflow-wrap: break-word;
}

.message.bot .message-content {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .10);
    color: var(--ocean-foam);
    border-top-left-radius: 5px;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--ocean-blue), var(--ocean-violet));
    color: #fff;
    border-top-right-radius: 5px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, .30);
}

.fuente-legal {
    margin-top: 10px;
    padding: 9px 12px;
    background: rgba(232, 131, 107, .10);
    border-left: 3px solid var(--coral);
    border-radius: 9px;
    font-size: .78rem;
    color: #F6C9BE;
}

.fuente-legal strong { color: var(--coral); font-weight: 600; }

.baja-confianza {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(255, 209, 0, .09);
    border: 1px solid rgba(255, 209, 0, .25);
    border-radius: 10px;
    font-size: .84rem;
    color: #F3E3A0;
}

.sugerencias-alternativas {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ---- Sugerencias ---- */
.suggestions {
    padding: 12px 20px 10px;
    background: rgba(5, 5, 8, .35);
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.suggestions-label {
    font-size: .70rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--ocean-pale);
    margin-bottom: 8px;
    font-weight: 600;
}

.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 76px;
    overflow-y: auto;
}

.suggestion-btn {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .80rem;
    font-family: 'Inter', sans-serif;
    color: var(--ocean-foam);
    cursor: pointer;
    transition: all .2s ease;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, var(--ocean-blue), var(--ocean-violet));
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, .40);
}

/* ---- Input ---- */
.chat-input {
    display: flex;
    padding: 14px 20px;
    gap: 10px;
    background: rgba(5, 5, 8, .45);
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.chat-input input {
    flex: 1;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: 12px 20px;
    font-size: .93rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    color: var(--ocean-foam);
    transition: all .2s ease;
}

.chat-input input::placeholder { color: rgba(184, 201, 224, .55); }

.chat-input input:focus {
    border-color: var(--ocean-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}

.chat-input button {
    width: 48px; height: 48px;
    border: none;
    background: linear-gradient(135deg, var(--ocean-blue), var(--ocean-violet));
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s ease;
    box-shadow: 0 6px 20px rgba(59, 130, 246, .35);
}

.chat-input button:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(139, 92, 246, .45);
}

.chat-input button svg { width: 21px; height: 21px; }

/* ---- Footer ---- */
.chat-footer {
    text-align: center;
    font-size: .72rem;
    color: var(--ocean-pale);
    padding: 9px;
    background: rgba(5, 5, 8, .5);
    border-top: 1px solid rgba(255, 255, 255, .07);
    letter-spacing: .4px;
}

/* ---- Typing ---- */
.typing-indicator { display: flex; gap: 4px; padding: 8px 0; }

.typing-indicator span {
    width: 8px; height: 8px;
    background: var(--ocean-violet);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* ---- Scrollbar ---- */
.chat-messages::-webkit-scrollbar,
.suggestion-buttons::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--ocean-blue), var(--ocean-violet));
    border-radius: 3px;
}

@media (max-width: 768px) {
    body { padding: 0; }
    .chat-container { height: 100vh; border-radius: 0; max-width: 100%; border: none; }
    .chat-header { padding: 14px 16px; }
    .header-text h1 { font-size: 1.25rem; }
    .subtitle { font-size: .64rem; }
    .logo-gto { width: 52px; height: 52px; }
    .message { max-width: 92%; }
}

/* ---- Pantalla PIN ---- */
.pin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, .92);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.pin-card {
    background: rgba(13, 27, 42, .85);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 22px;
    padding: 38px 34px;
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 24px 70px rgba(59, 130, 246, .25);
}
.pin-logo { width: 84px; height: 84px; object-fit: contain; margin-bottom: 14px; }
.pin-card h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: #fff; font-size: 1.5rem; margin-bottom: 4px;
}
.pin-sub { color: #B8C9E0; font-size: .8rem; margin-bottom: 22px; }
.pin-label { color: #D4E4F7; font-size: .85rem; margin-bottom: 10px; }
#pinInput {
    width: 100%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    padding: 12px 18px;
    text-align: center;
    font-size: 1.05rem;
    letter-spacing: 4px;
    color: #fff;
    outline: none;
    font-family: 'Inter', sans-serif;
}
#pinInput:focus { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.pin-error {
    display: none;
    color: #F4978E; font-size: .8rem; margin-top: 10px;
}
.pin-btn {
    margin-top: 18px;
    width: 100%;
    border: none;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: .95rem;
    padding: 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 8px 24px rgba(59, 130, 246, .35);
}
.pin-btn:hover { transform: scale(1.02); box-shadow: 0 10px 30px rgba(139, 92, 246, .45); }
