/* Consultora IA — chat widget for Mellouk Beauty landing */
:root {
    --consultora-rose: #C9607A;
    --consultora-rose-dark: #8B3650;
    --consultora-rose-soft: #F5DDE4;
    --consultora-cream: #FAF8F5;
    --consultora-charcoal: #1F1A1D;
    --consultora-charcoal-muted: #6b6560;
    --consultora-border: #EADFE3;
    --consultora-shadow: 0 20px 50px rgba(139, 54, 80, 0.12);
    --consultora-radius: 20px;
}

.consultora-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3rem;
}

.consultora-intro {
    text-align: center;
    margin-bottom: 1.75rem;
}

.consultora-intro h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.85rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--consultora-charcoal);
}

.consultora-intro .lead {
    font-size: 1.05rem;
    color: var(--consultora-charcoal-muted);
    max-width: 520px;
    margin: 0 auto;
}

/* ── CTA: Analyze Hair & Skin ── */
.cta-analyze {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.5rem auto 0;
    max-width: 480px;
    padding: 0.9rem 1.25rem;
    background: linear-gradient(135deg, var(--consultora-rose), #D4789A);
    color: #fff;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(201, 96, 122, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: cta-pulse 2.5s ease-in-out infinite;
}
.cta-analyze:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 32px rgba(201, 96, 122, 0.45);
    animation: none;
}
.cta-analyze-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.cta-analyze-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.cta-analyze-text strong {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}
.cta-analyze-text small {
    font-size: 0.8rem;
    opacity: 0.85;
    line-height: 1.3;
}
.cta-analyze-arrow {
    font-size: 1.1rem;
    opacity: 0.8;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.cta-analyze:hover .cta-analyze-arrow {
    transform: translateX(4px);
}
@keyframes cta-pulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(201, 96, 122, 0.35); }
    50%      { box-shadow: 0 8px 32px rgba(201, 96, 122, 0.55); }
}

.chat-shell {
    margin: 0 auto 2rem;
}

.chat-card {
    background: #fff;
    border: 1px solid var(--consultora-border);
    border-radius: var(--consultora-radius);
    box-shadow: var(--consultora-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: min(70vh, 620px);
    max-height: min(80vh, 780px);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--consultora-border);
    background: linear-gradient(180deg, #FFF 0%, #FDF6F8 100%);
}

.chat-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C9607A 0%, #8B3650 100%);
    color: #fff;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(139, 54, 80, 0.2);
}

.chat-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--consultora-charcoal);
}

.chat-status {
    font-size: 0.8rem;
    color: var(--consultora-charcoal-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--consultora-rose-soft);
    color: var(--consultora-rose);
    font-size: 1rem;
    transition: transform 120ms ease, background 160ms ease, color 160ms ease;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: #F2CED7;
}

.icon-btn[aria-pressed="true"] {
    background: var(--consultora-rose);
    color: #fff;
}

.icon-btn.send {
    background: linear-gradient(135deg, #C9607A 0%, #8B3650 100%);
    color: #fff;
}

.icon-btn.send:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.icon-btn.mic[aria-pressed="true"] {
    animation: mic-pulse 1.4s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

.chat-error {
    margin: 0;
    padding: 0.65rem 1.1rem;
    background: #FDECEF;
    color: var(--consultora-rose-dark);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--consultora-border);
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    background:
        linear-gradient(180deg, rgba(245, 221, 228, 0.35) 0%, var(--consultora-cream) 100%);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    scroll-behavior: smooth;
}

.bubble-row {
    display: flex;
    width: 100%;
}

.bubble-row.client {
    justify-content: flex-end;
}

.bubble-row.ai {
    justify-content: flex-start;
}

.bubble {
    max-width: min(75%, 520px);
    padding: 0.7rem 0.95rem;
    border-radius: 18px;
    font-size: 0.98rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(31, 26, 29, 0.05);
}

.bubble-row.client .bubble {
    background: linear-gradient(135deg, #C9607A 0%, #8B3650 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.bubble-row.ai .bubble {
    background: #fff;
    color: var(--consultora-charcoal);
    border: 1px solid rgba(201, 96, 122, 0.18);
    border-bottom-left-radius: 6px;
}

.bubble-time {
    font-size: 0.7rem;
    color: var(--consultora-charcoal-muted);
    margin-top: 0.25rem;
    padding: 0 0.25rem;
}

.typing {
    display: inline-flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(201, 96, 122, 0.18);
    border-bottom-left-radius: 6px;
    align-self: flex-start;
}

.typing span {
    width: 7px;
    height: 7px;
    background: rgba(201, 96, 122, 0.7);
    border-radius: 50%;
    display: inline-block;
    animation: typing-bounce 1.1s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
    30%           { transform: translateY(-4px); opacity: 1; }
}

.chat-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--consultora-border);
    background: #fff;
}

.chat-input input[type="text"] {
    flex: 1;
    border: 1px solid rgba(201, 96, 122, 0.3);
    border-radius: 999px;
    padding: 0.7rem 1rem;
    font: inherit;
    font-size: 0.98rem;
    background: #fff;
    color: var(--consultora-charcoal);
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.chat-input input[type="text"]:focus {
    border-color: var(--consultora-rose);
    box-shadow: 0 0 0 3px rgba(201, 96, 122, 0.15);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.consultora-tips {
    background: #fff;
    border: 1px solid var(--consultora-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(31, 26, 29, 0.04);
}

.consultora-tips h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    color: var(--consultora-charcoal);
    margin-bottom: 0.85rem;
}

.consultora-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.55rem;
}

.consultora-tips li {
    padding-left: 1.4rem;
    position: relative;
    color: var(--consultora-charcoal-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.consultora-tips li::before {
    content: '✦';
    color: var(--consultora-rose);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .consultora-main { padding: 1.5rem 0.75rem 2rem; }
    .chat-card { border-radius: 16px; min-height: min(75vh, 560px); }
    .chat-input { padding: 0.6rem; }
    .chat-input input[type="text"] { padding: 0.65rem 0.9rem; }
    .icon-btn { width: 42px; height: 42px; }
    .bubble { max-width: 85%; }
}

/* Install App button */
.btn-install-consultora {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: #fff !important;
    border: 0;
    padding: 10px 18px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(147, 51, 234, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: consultora-pulse 2.5s ease-in-out infinite;
}
.btn-install-consultora:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 20px rgba(147, 51, 234, 0.5);
}
@keyframes consultora-pulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(147, 51, 234, 0.35); }
    50%      { box-shadow: 0 4px 20px rgba(147, 51, 234, 0.55); }
}

/* Install modal (shared BEM with landing page) */
.install-modal { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; padding: 16px; }
.install-modal.is-open { display: flex; }
.install-modal__backdrop { position: absolute; inset: 0; background: rgba(20, 10, 40, 0.6); backdrop-filter: blur(4px); }
.install-modal__dialog { position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 28px 24px 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.35); animation: modal-in 0.22s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.install-modal__close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; background: transparent; border: 0; font-size: 24px; color: #666; cursor: pointer; border-radius: 50%; }
.install-modal__close:hover { background: #f3e8ff; color: #9333ea; }
.install-modal__icon { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #9333ea, #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.install-modal__title { margin: 0 0 4px; font-family: 'Playfair Display', serif; font-size: 1.35rem; color: #1a1a2e; }
.install-modal__subtitle { margin: 0 0 14px; font-size: 0.9rem; color: #555; line-height: 1.45; }
.install-modal__steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.install-modal__steps li { display: flex; gap: 12px; align-items: flex-start; background: #f5f0ff; border: 1px solid #e9d5ff; border-radius: 14px; padding: 10px 12px; font-size: 0.88rem; color: #1a1a2e; }
.install-modal__num { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; background: #fff; color: #9333ea; display: flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 1px 4px rgba(147, 51, 234, 0.15); }
.install-modal__steps small { color: #555; line-height: 1.4; }
.install-modal__hint { margin: 10px 0 14px; padding: 10px 12px; background: #f5f0ff; border-radius: 12px; font-size: 0.8rem; color: #6b21a8; line-height: 1.45; }
.install-modal__ok { width: 100%; padding: 12px 16px; background: #7c3aed; color: #fff; border: 0; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; }
.install-modal__ok:hover { background: #6d28d9; }
