/* Explain: Styles for the Miss Founder chat assistant launcher and panel. */
/* Miss Founder — FOUNDER500™ floating chat assistant.
   A launcher pill in the bottom-right corner carries the Miss Founder avatar and opens a
   chat panel that keeps the conversation across pages. Deep navy and pale-gold brand tones,
   with two call-to-action capsules that close every conversation. */

/* Launcher ---------------------------------------------------------------- */

.mf-launcher {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 130;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 3.6rem;
    padding: 0.4rem 1.1rem 0.4rem 0.4rem;
    border: 1px solid rgba(232, 213, 140, 0.5);
    border-radius: var(--radius-pill);
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 18px 42px rgba(20, 41, 67, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mf-launcher:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 54px rgba(20, 41, 67, 0.44);
}

.mf-launcher.mf-off {
    display: none;
}

.mf-launcher-avatar {
    position: relative;
    width: 2.85rem;
    height: 2.85rem;
    flex: 0 0 auto;
    overflow: hidden;
    border: 2px solid var(--accent-color);
    border-radius: 999px;
    background: #0E1F35;
}

.mf-launcher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mf-online {
    position: absolute;
    right: 0.05rem;
    bottom: 0.05rem;
    width: 0.8rem;
    height: 0.8rem;
    border: 2px solid var(--primary-color);
    border-radius: 999px;
    background: var(--success-color);
    animation: mfPulse 2s infinite;
}

@keyframes mfPulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 125, 91, 0.6); }
    70% { box-shadow: 0 0 0 0.5rem rgba(46, 125, 91, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 125, 91, 0); }
}

.mf-launcher-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.mf-launcher-name {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.mf-launcher-tag {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 480px) {
    .mf-launcher {
        padding: 0.35rem;
    }

    .mf-launcher-text {
        display: none;
    }
}

/* Panel ------------------------------------------------------------------- */

.mf-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 131;
    display: none;
    flex-direction: column;
    width: min(100vw - 2rem, 24rem);
    height: min(82vh, 34rem);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: #ffffff;
    box-shadow: var(--shadow-pop);
}

.mf-panel.is-open {
    display: flex;
    animation: mfPanelIn 0.22s ease;
}

@keyframes mfPanelIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.mf-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 0 0 auto;
    padding: 0.85rem 1rem;
    background: linear-gradient(110deg, var(--primary-color), #0E1F35);
    color: #ffffff;
}

.mf-head-avatar {
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    overflow: hidden;
    border: 2px solid var(--accent-color);
    border-radius: 999px;
}

.mf-head-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mf-head-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mf-head-copy strong {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 800;
}

.mf-head-copy span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.72);
}

.mf-head-actions {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
}

.mf-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.6rem;
    background: transparent;
    color: #ffffff;
    font-size: 0.78rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mf-icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Message area ------------------------------------------------------------ */

.mf-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.7rem;
    overflow-y: auto;
    padding: 1rem;
    background: var(--surface-color);
}

.mf-msg {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 100%;
}

.mf-msg-user {
    justify-content: flex-end;
}

.mf-msg-avatar {
    width: 1.9rem;
    height: 1.9rem;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #ffffff;
}

.mf-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mf-bubble {
    max-width: 82%;
    border-radius: 1rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mf-bubble-bot {
    border: 1px solid var(--border-color);
    border-top-left-radius: 0.25rem;
    background: #ffffff;
    color: var(--text-color);
}

.mf-bubble-user {
    border-top-right-radius: 0.25rem;
    background: var(--primary-color);
    color: #ffffff;
}

.mf-bubble-error {
    border: 1px solid var(--error-color);
    background: var(--error-bg);
    color: var(--error-color);
}

.mf-typing {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.mf-typing i {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--text-muted);
    animation: mfTyping 1s infinite;
}

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

@keyframes mfTyping {
    0%, 60%, 100% { opacity: 0.28; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* Call-to-action capsules ------------------------------------------------- */

.mf-cta {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.2rem;
    padding-left: 2.4rem;
}

.mf-cta-title {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mf-cta-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 3rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: #ffffff;
    padding: 0.5rem 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mf-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.mf-cta-btn > i {
    width: 1.2rem;
    flex: 0 0 auto;
    text-align: center;
    font-size: 1.05rem;
}

.mf-cta-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
    text-align: left;
}

.mf-cta-copy strong {
    font-family: var(--font-heading);
    font-size: 0.83rem;
    font-weight: 700;
}

.mf-cta-copy small {
    font-size: 0.66rem;
    font-weight: 600;
}

.mf-cta-telegram {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #ffffff;
}

.mf-cta-telegram > i {
    color: var(--accent-color);
}

.mf-cta-telegram small {
    color: rgba(255, 255, 255, 0.72);
}

.mf-cta-membership {
    border-color: var(--accent-strong);
    background: var(--accent-color);
    color: var(--primary-color);
}

.mf-cta-membership > i {
    color: var(--primary-color);
}

.mf-cta-membership small {
    color: var(--accent-deep);
}

/* Composer ---------------------------------------------------------------- */

.mf-foot {
    flex: 0 0 auto;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    padding: 0.7rem 0.85rem 0.8rem;
}

.mf-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.mf-input {
    flex: 1;
    min-height: 2.75rem;
    max-height: 7rem;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    background: var(--field-bg);
    padding: 0.7rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.mf-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(20, 41, 67, 0.1);
}

.mf-input::placeholder {
    color: var(--text-muted);
    opacity: 0.85;
}

.mf-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    border: 0;
    border-radius: 0.85rem;
    background: var(--primary-color);
    color: #ffffff;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.mf-send:hover {
    background: var(--primary-hover);
}

.mf-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mf-note {
    margin-top: 0.5rem;
    font-size: 0.65rem;
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .mf-launcher,
    .mf-cta-btn { transition: none; }
    .mf-online,
    .mf-typing i { animation: none; }
    .mf-panel.is-open { animation: none; }
}