@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-main: #111114;
    --accent: #007AFF;
    --glass-bg: rgba(28, 28, 30, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide scrollbar visually but keep scrolling functional */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
    display: none;
}

html,
body {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background mesh - Using the original premium image */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: url('abstract_ios_mesh_gradient_1768078441815.png') center/cover no-repeat;
    filter: brightness(0.7);
}

.bg-mesh::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 20%, rgba(0, 0, 0, 0.4) 100%);
}

/* Glass Card Style */
.glass-card {
    background: rgb(27 27 30 / 79%);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border-radius: 30px;
    position: relative;
    padding: 24px;
    border: none;
}

/* The Glint Effect */
.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.40) 0%,
            rgba(255, 255, 255, 0.1) 25%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.1) 75%,
            rgba(255, 255, 255, 0.20) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

/* Removed active state opacity to prevent darkening */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Smooth fade from background color to total transparency */
    background: linear-gradient(to bottom,
            var(--bg-main) 0%,
            var(--bg-main) 40%,
            rgba(17, 17, 20, 0.8) 70%,
            rgba(17, 17, 20, 0) 100%);
    padding-bottom: 50px;
    /* Longer fade area for a 'shadow' effect */
    pointer-events: none;
    /* Let clicks pass through the fade area */
}

.header-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
    /* Re-enable clicks for active elements */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    display: none;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

nav a:hover {
    color: #fff;
}

.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
    pointer-events: auto;
}

.burger-menu span {
    width: 25px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 80px 0;
    text-align: center;
}

#accounts {
    padding: 60px 0;
}

#features {
    padding: 100px 0;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -2px;
    line-height: 1.1;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Product Tabs Switcher */
.tabs-outer {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.product-tabs {
    display: flex;
    padding: 6px;
    border-radius: 100px;
    position: relative;
    /* For the indicator */
}

.tab-indicator {
    position: absolute;
    top: 6px;
    left: 6px;
    height: calc(100% - 12px);
    background: rgb(44 44 49 / 85%);
    border-radius: 100px;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1;
}

.tab-btn {
    padding: 12px 28px;
    border-radius: 100px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    /* Content above indicator */
}

.tab-btn.active {
    color: #fff;
}

/* Removed active tab glint to fix layering overlap */

/* Slider Container */
.slider-container {
    overflow: hidden;
    width: 100%;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-section {
    flex: 0 0 100%;
    width: 100%;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.product-card .price {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 15px 0 25px;
}

.delivery-type {
    font-size: 0.9rem;
    color: var(--accent);
    margin-top: auto;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
    background: rgb(255 255 255 / 1%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 18px;
    text-align: left;
}

.product-note svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.product-card .limit {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 10px;
}

.product-card .features {
    list-style: none;
    margin-bottom: 30px;
    flex-grow: 1;
}

.product-card .features li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.btn {
    padding: 14px 28px;
    border-radius: 16px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn:active {
    transform: scale(0.96);
    filter: brightness(0.9);
}

/* Badge with Liquid Glass Style */
.badge {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
    position: relative;
    color: var(--text-primary);
}

.badge::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0.1) 25%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.1) 75%,
            rgba(255, 255, 255, 0.2) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

/* FAQ Section Styles */
.faq-container {
    max-width: 800px;
    margin: 80px auto;
    padding-bottom: 100px;
}

.faq-item {
    margin-bottom: 12px;
    padding: 0;
}

.faq-trigger {
    width: 100%;
    text-align: left;
    padding: 24px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
    user-select: none;
}

.faq-trigger span:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-icon {
    font-size: 0.75rem;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0.4;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
}

.faq-item.active .faq-content {
    max-height: 500px;
    /* Reduced from 800px to make closing feel faster */
    opacity: 1;
}

.faq-content-inner {
    padding: 0 30px 30px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

/* Modal System */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 450px;
    min-height: 300px;
    background: rgba(28, 28, 30, 0.9);
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 50px 30px 40px;
    text-align: center;
    position: relative;
    pointer-events: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-content.dragging {
    transition: none !important;
}

/* Error Tooltip */
.error-tooltip {
    position: absolute;
    top: 32px;
    /* Positioned closer to the input */
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: rgba(255, 59, 48, 0.25);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: none;
    color: #ff3b30;
    padding: 8px 16px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 10;
}

.error-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-105%);
}

.error-tooltip::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(255, 59, 48, 0.25);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.close-modal svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    h1 {
        font-size: 3.5rem;
    }
}

/* Mobile Side Menu */
.mobile-side-menu {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.mobile-side-menu.active {
    opacity: 1;
    visibility: visible;
}

.side-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    padding: 80px 30px;
    background: rgba(17, 17, 20, 0.85);
    /* Slightly more transparent for better blur effect */
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: none;
}

.side-menu-content::before {
    display: none;
    /* Remove the glass-card glint border */
}

.mobile-side-menu.active .side-menu-content {
    transform: translateX(0);
}

.close-side-menu {
    position: absolute;
    top: 25px;
    right: 25px;
    cursor: pointer;
    opacity: 0.6;
}

.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.mobile-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .burger-menu {
        display: flex;
    }

    .hero {
        padding: 60px 0;
    }

    h1 {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 30px;
    }

    #features {
        padding: 40px 0 !important;
    }

    #accounts {
        padding: 20px 0 !important;
    }

    .products-grid {
        grid-template-columns: 1fr;
        padding: 20px 0;
    }

    .faq-trigger {
        padding: 20px;
        font-size: 1rem;
    }

    /* Modal Mobile Styles (Bottom Sheet) */
    .modal-overlay {
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 32px 32px 0 0;
        transform: translateY(100%);
        padding: 40px 20px 60px;
    }

    .modal-overlay.active .modal-content {
        transform: translateY(0);
    }

    /* Handle for the bottom sheet */
    .modal-content::before {
        content: "";
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.25);
        /* Lighter color */
        border-radius: 10px;
        mask: none;
        /* Ensure no mask is interfering */
        -webkit-mask: none;
        padding: 0;
        /* Reset padding if inherited */
    }

    .close-modal {
        display: none;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.2rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .container {
        padding: 0 15px;
    }
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.chat-button {
    height: 48px;
    padding: 0 20px;
    background: var(--accent);
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-button span {
    white-space: nowrap;
}

.chat-button:hover {
    background: #1a87ff;
    /* Slight color change instead of scale */
}

.chat-button:active {
    transform: scale(0.95);
}

.chat-window {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 380px;
    height: 600px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
}

.chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
}

/* Message Animations */
@keyframes messageSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes messageSlideInRight {
    from {
        opacity: 0;
        transform: translateX(15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.system {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    animation: messageSlideInLeft 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.message.user {
    background: var(--accent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    animation: messageSlideInRight 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.chat-input-container {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
}

.chat-input-container input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 30px;
    padding: 12px 18px;
    color: white;
    outline: none;
    font-size: 0.95rem;
    transition: background 0.3s;
}

.chat-input-container input:focus {
    background: rgba(255, 255, 255, 0.1);
}

#chat-send {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 30px;
    border: none;
    outline: none;
    cursor: pointer;
    background: var(--accent);
    color: white;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none;
}

#chat-send:hover {
    background: #0084ff;
}

#chat-send:active {
    transform: scale(0.92);
    background: #0066d6;
    filter: none;
    /* Убираем фильтр, чтобы не было глюков обводки */
}

#chat-send svg {
    pointer-events: none;
}

/* Mobile full screen override */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 20px;
        right: 20px;
    }

    .chat-window {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        bottom: 0;
        right: 0;
        transform: translateY(100%);
        transform-origin: bottom;
    }

    .chat-window.active {
        transform: translateY(0);
    }

    #chat-close {
        display: flex !important;
        /* Force display since .close-modal is hidden on mobile */
    }

    .chat-header {
        padding: 20px;
    }

    .chat-window::before {
        display: none;
        /* Remove glint on full screen to keep it clean */
    }
}