:root {
    /* Base Telegram variables fallback */
    --tg-theme-bg-color: #0b101a;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #8b9bb4;
    --tg-theme-link-color: #4da6ff;
    --tg-theme-button-color: #2b70d4;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #151e32;

    /* Primary brand colors */
    --brand-primary: #5e6ad2;
    --brand-secondary: #9c27b0;
    --brand-accent: #00f2fe;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* Use TG background, but fallback to a nice dark gradient if not in TG */
    background: radial-gradient(circle at top right, #111827, #0B101A);
    color: var(--tg-theme-text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Removed body background glow effects for cleaner look */

@keyframes pulseGlow {
    0% {
        transform: scale(1);
        opacity: 0.2;
    }

    100% {
        transform: scale(1.2);
        opacity: 0.4;
    }
}

@keyframes drift {
    0% {
        transform: translateY(0) translateX(0);
    }

    100% {
        transform: translateY(-30px) translateX(-50px);
    }
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

/* Header bot image icon styling */
.header-icon-container {
    position: relative;
    width: 40px;
    height: 40px;
}

.header-bot-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.header-icon-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--brand-secondary), var(--brand-accent));
    border-radius: 12px;
    filter: blur(8px);
    opacity: 0.7;
    z-index: 1;
    animation: rotateGlow 4s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes rotateGlow {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

h1.title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #aeb9e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

p.subtitle {
    font-size: 1.1rem;
    color: var(--tg-theme-hint-color);
    max-width: 500px;
    margin: 0 auto 2.5rem auto;
}

/* Features Glassmorphism Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 3rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    animation: fadeInUp 0.8s ease-out backwards;
}

.feature-card:nth-child(1) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.3s;
}

.feature-card:nth-child(4) {
    animation-delay: 0.4s;
}

.feature-card:nth-child(5) {
    animation-delay: 0.5s;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 15px rgba(94, 106, 210, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin-bottom: 0;
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 12px;
    color: var(--brand-accent);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.1);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.25);
    transform: scale(1.05);
    color: #fff;
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #fff;
    line-height: 1.3;
}

.feature-desc {
    font-size: 0.95rem;
    color: var(--tg-theme-hint-color);
}

.highlight {
    color: var(--brand-accent);
    font-weight: 600;
}

/* Call to Action Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #2AABEE, #229ED9);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    padding: 1.2rem 3rem;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(42, 171, 238, 0.4), inset 0 2px 2px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.cta-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }

    20% {
        transform: translateX(100%) rotate(30deg);
    }

    100% {
        transform: translateX(100%) rotate(30deg);
    }
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 35px rgba(42, 171, 238, 0.5), inset 0 2px 2px rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #35B5F4, #2AABEE);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.main-header {
    width: 100%;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.header-glow {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 250px;
    height: 250px;
    background: var(--brand-secondary);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
    animation: pulseGlow 5s infinite alternate;
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.header-logo .accent {
    color: var(--brand-accent);
}

.header-nav {
    display: flex;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.header-nav a {
    color: var(--tg-theme-text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.3s, color 0.3s;
}

.header-nav a:hover {
    opacity: 1;
    color: var(--brand-accent);
}

/* Footer */
.main-footer {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--tg-theme-hint-color);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--tg-theme-text-color);
    text-decoration: none;
}

.copyright {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

/* Legal Documents Content (Terms & Privacy) */
.legal-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    text-align: left;
}

.legal-content h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.legal-content h2 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--brand-accent);
}

.legal-content p {
    margin-bottom: 1rem;
    color: #d1d5db;
    line-height: 1.7;
}

.legal-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: #d1d5db;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

@media (max-width: 600px) {
    .legal-content {
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-logo span {
        white-space: nowrap;
    }

    .header-icon-container,
    .header-bot-logo {
        width: 35px;
        height: 35px;
    }

    .header-logo {
        font-size: 1.3rem;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.6rem;
        align-items: center;
        margin-bottom: 1.2rem;
    }
}

/* Hide CTA button initially if inside TMA (will use MainButton instead) */
.web-app-active .cta-button {
    display: none;
}