/* Telegram contact widget — terminal theme overrides */

.telegram-widget-wrap {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 10001;
    pointer-events: none;
}

.telegram-widget-wrap > * {
    pointer-events: auto;
}

.telegram-widget-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.telegram-widget-backdrop:not([hidden]) {
    opacity: 1;
}

.telegram-widget-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.75rem);
    width: 380px;
    max-width: calc(100vw - 2rem);
    padding: 1.5rem 1.35rem 1.35rem;
    border-radius: 0;
    background: #03070d;
    border: 1px solid rgba(0, 116, 217, 0.45);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.55);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    transform: translateY(10px) scale(0.98);
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom right;
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.24s ease,
        visibility 0.24s ease;
}

.telegram-widget-wrap.is-open .telegram-widget-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.telegram-widget-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.telegram-widget-close:hover {
    background: rgba(0, 116, 217, 0.15);
    border-color: rgba(0, 116, 217, 0.5);
    color: #5fb0ff;
}

.telegram-widget-content {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.telegram-widget-badge {
    width: 48px;
    height: 48px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0074D9;
    color: #fff;
    border: 1px solid rgba(95, 176, 255, 0.4);
}

.telegram-widget-title {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.35;
    color: #fff;
    padding-right: 2rem;
    letter-spacing: -0.01em;
}

.telegram-widget-lead {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
}

.telegram-widget-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 44px;
    padding: 0.85rem 1rem;
    border-radius: 0;
    background: rgba(0, 116, 217, 0.2);
    color: #fff !important;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border: 1px solid #0074D9;
    transition: background 0.2s ease;
}

.telegram-widget-cta:hover {
    background: rgba(0, 116, 217, 0.35);
    text-decoration: none;
}

.telegram-widget-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.telegram-widget-divider::before,
.telegram-widget-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.telegram-widget-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.telegram-widget-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    color: #f8fafc;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.telegram-widget-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.telegram-widget-input:focus {
    outline: none;
    border-color: #0074D9;
    box-shadow: 0 0 0 2px rgba(0, 116, 217, 0.25);
}

.telegram-widget-input.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.15);
}

.telegram-widget-handle-cta {
    width: 100%;
    min-height: 44px;
    padding: 0.85rem 1rem;
    border-radius: 0;
    border: 1px solid #0074D9;
    background: #0074D9;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.telegram-widget-handle-cta:hover:not(:disabled) {
    background: rgba(0, 116, 217, 0.85);
}

.telegram-widget-handle-cta:disabled {
    opacity: 0.65;
    cursor: wait;
}

.telegram-widget-feedback {
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0;
}

.telegram-widget-feedback.is-success {
    color: #7CFFB2;
}

.telegram-widget-feedback.is-error {
    color: #f87171;
}

.telegram-widget-note {
    font-size: 0.75rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.1rem;
}

.telegram-widget-fab {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    height: 48px;
    padding: 0 1.1rem 0 0.6rem;
    border: 1px solid rgba(0, 116, 217, 0.55);
    border-radius: 0;
    background: rgba(0, 116, 217, 0.18);
    color: #fff;
    cursor: pointer;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    box-shadow: 0 10px 28px rgba(0, 116, 217, 0.25);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.telegram-widget-fab:hover {
    transform: translateY(-2px);
    background: rgba(0, 116, 217, 0.3);
    border-color: #0074D9;
}

.telegram-widget-fab-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #0074D9;
}

.telegram-widget-fab-text {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

@media (max-width: 767px) {
    .telegram-widget-wrap {
        right: 0.75rem;
        bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    }

    .telegram-widget-fab-text {
        display: none;
    }

    .telegram-widget-fab {
        width: 48px;
        height: 48px;
        padding: 0;
    }
}

body.telegram-widget-open {
    overflow: hidden;
}

/* Site menu panel — full-width Lovable-style drawer */
.landing-menu-panel {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 60;
    display: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(3, 7, 13, 0.98);
    backdrop-filter: blur(8px);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    animation: site-menu-in 150ms ease-out both;
}

.landing-menu-panel.is-open,
.landing-menu-panel:not([hidden]) {
    display: block;
}

.landing-menu-panel[hidden] {
    display: none !important;
}

.landing-submenu {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    animation: submenu-in 120ms ease-out both;
}

.landing-submenu[hidden] {
    display: none !important;
}

.rotate-180 {
    transform: rotate(180deg);
}

@keyframes site-menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes submenu-in {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-menu-panel,
    .landing-submenu {
        animation: none !important;
    }
}

/* Terminal dialogs (contact + live demo) */
.landing-terminal-dialog {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.landing-terminal-dialog[hidden] {
    display: none !important;
}

.landing-terminal-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.landing-terminal-dialog__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 100dvh;
    overflow: auto;
    border: 1px solid rgba(0, 116, 217, 0.5);
    background: #03070d;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 60px -10px rgba(0, 116, 217, 0.4);
}

.landing-terminal-dialog__panel--md {
    max-width: 32rem;
}

.landing-terminal-dialog__panel--lg {
    max-width: 42rem;
}

.landing-terminal-dialog__panel--xl {
    max-width: 56rem;
}

.landing-terminal-dialog__chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.25rem;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.5);
}

.landing-terminal-dialog__esc {
    display: inline-flex;
    min-height: 2.75rem;
    min-width: 2.75rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0 0.5rem;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.landing-terminal-dialog__esc:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.landing-terminal-dialog__body {
    padding: 1.25rem;
    font-size: 13px;
    line-height: 1.625;
}

body.landing-dialog-open {
    overflow: hidden;
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes lifecycle-fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lifecycle-line {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes lifecycle-progress {
    from { width: 0%; }
    to { width: 100%; }
}

.variant-frame img[data-paylogo="true"] {
    background: #ffffff;
    border-radius: 10px;
    padding: 6px;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px rgba(2, 6, 26, 0.14);
}

.variant-frame img[data-paylogo="true"][data-paylogo-size="lg"] {
    padding: 4px;
}

.lifecycle-console-line {
    animation: lifecycle-line 0.22s ease-out both;
}

.lifecycle-console {
    animation: lifecycle-fade 0.28s ease-out both;
}

/* ==========================================================================
   FAB dock — AI support + Telegram side-by-side (from staging)
   ========================================================================== */

.landing-fab-dock {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 10001;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.landing-fab-dock > * {
    pointer-events: auto;
    position: relative;
    right: auto;
    bottom: auto;
    flex-shrink: 0;
}

.landing-fab-dock #supportChatWrap {
    order: 1;
}

.landing-fab-dock #telegramWidgetWrap {
    order: 2;
}

.landing-fab-dock .telegram-widget-wrap,
.landing-fab-dock .support-chat-widget-wrap {
    position: relative;
    right: auto;
    bottom: auto;
}

@media (max-width: 767px) {
    .landing-fab-dock {
        right: 0.75rem;
        bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
        gap: 6px;
    }

    .landing-fab-dock .support-chat-widget-wrap--landing.is-open .support-chat-widget-panel,
    .landing-fab-dock .telegram-widget-wrap.is-open .telegram-widget-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(9.5rem + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: none;
        max-height: min(60vh, calc(100vh - 12rem));
        transform-origin: bottom center;
        z-index: 10002;
    }
}

/* Restyle support chat FAB to match terminal theme when on landing */
.landing-fab-dock .support-chat-widget-fab {
    border-radius: 0 !important;
    border: 1px solid rgba(0, 116, 217, 0.55) !important;
    background: rgba(0, 116, 217, 0.18) !important;
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    box-shadow: 0 10px 28px rgba(0, 116, 217, 0.25) !important;
}

.landing-fab-dock .support-chat-widget-fab:hover {
    background: rgba(0, 116, 217, 0.3) !important;
    border-color: #0074D9 !important;
}

/* Primary marketing CTA button — Lovable parity */
button.landing-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    border: 1px solid #0074D9;
    background: rgba(0, 116, 217, 0.15);
    padding: 0.5rem 1rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    line-height: 1.25;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
button.landing-cta-btn:hover {
    background: rgba(0, 116, 217, 0.3);
}
button.landing-cta-btn--ghost {
    border-color: rgba(255, 255, 255, 0.2);
    background: transparent;
}
button.landing-cta-btn--ghost:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: transparent;
}
