/* ==========================================================================
   1. VARIABLES & BASE STYLES
   ========================================================================== */
:root {
    --bg: #fcfcfd;
    --text: #0f172a;
    --muted: #5b6472;
    --line: rgba(0, 0, 0, 0.06);
    --accent: #3435b1;
    --border-color: #3435b133;
    --light-accent: #3435b111;
}

* {
    box-sizing: border-box;
}

/* ЗАДЪЛЖИТЕЛНО: html и body трябва да са 100% обвързани по височина */
html {
	max-width: 100%;
    overflow-x: hidden;
    height: 100%;
}

body {
    font-family: "Montserrat", sans-serif;
    font-size: 22px;
    line-height: 1.3;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    max-width: 100%;
    overflow-x: hidden;
    
    /* Магическата комбинация: */
    min-height: 100%;
    position: relative;
    padding-bottom: 120px; /* Свободно място най-отдолу, колкото да диша футерът и да не застъпва нищо */
	
	
	width: 100%;
    max-width: 100vw;

}


/* Common Layout Utilities */
.wrap, .story, .section, .cards-wrap, .nav { 
    width: 100%;
    max-width: 1400px; 
    margin: 0 auto;
}

.hero-grid, .story-grid, .section {
    gap: 48px;
}

/* ==========================================================================
   2. NAVIGATION & HEADER
   ========================================================================== */
header {
    position: fixed;
	width: 100%;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: rgb(252 252 253 / 0.75);
}

.nav {
   
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: "Share Tech", sans-serif;
    font-size: 50px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.brand a {
    color: inherit;
    text-decoration: none;
}

.links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.links a {
    text-decoration: none;
    color: var(--text);
    font-size: 20px;
}

.cta {
    text-decoration: none;
    color: #000000;
    padding: 10px 16px;
    border: 1px solid rgb(0 0 0 / 0.12);
    border-radius: 999px;
    transition: all .3s ease;
}

.cta:hover {   
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================================
   3. HERO SECTION & VISUAL EFFECTS
   ========================================================================== */
.hero {
    position: relative;
    padding-bottom: 40px;
}

.grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--line) 1px, transparent 1px),
                      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.3;
}

.flow:before {
    content: "";
    position: absolute;
    
    /* Правим самата кутия безпощадно малка */
    width: 0;
    height: 0;
    padding: 450px; /* Сборът прави точно 900px радиус на блура */
    border-radius: 50%;
    
    background: radial-gradient(circle, #2563eb, transparent 70%);
    top: -200px;
    right: -200px; /* Връщаш си оригиналната позиция, за да си прелива меко */
    filter: blur(90px);
    opacity: 0.15;
}


.flow:after {
    content: "";
    position: absolute;
    
    /* Правим кутията 0x0 и тук */
    width: 0;
    height: 0;
    padding: 450px; /* Отново прави общо 900px радиус за блура */
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.15;
    
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -300px;
    left: -250px; /* Връщаш си оригиналната позиция до пиксел */
}



.wrap {
    padding: 140px 40px 0;
    position: relative;
    z-index: 2;
}

.hero-grid {
    display: grid;
    grid-template-columns: 65% 35%;
    align-items: center;
}

.kicker {
    font-size: 11px;
    letter-spacing: 0.25em;
    color: var(--accent);
    margin-bottom: 22px;
}

h1 {
    font-size: clamp(36px, 5vw, 100px);
    line-height: 0.95;
    letter-spacing: 0;
    margin: 0;
}

.sub {
    margin-top: 28px;
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 600;
    color: var(--accent);
}

.hero-actions {
    margin: 40px 0;
}

.hero-actions a {
    display: inline-block;
    padding: 14px 22px;
    border: 1px solid rgb(0 0 0 / 0.12);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-size: 20px;
}

.mesh svg {
    width: 100%;
    height: auto;
    max-height: 720px;
    display: block;
}

/* ==========================================================================
   4. CONTENT SECTIONS & CARDS
   ========================================================================== */

.story {
    padding: 24px 40px 48px;
    position: relative;
    z-index: 2;
}

.story-grid {
    display: grid;
    grid-template-columns: 58% 42%;
}

.copy {
    font-size: clamp(24px, 2vw, 38px);
    line-height: 1.3;
    max-width: 860px;
    padding-left: 30px;
    border-left: 4px solid var(--border-color);
    align-content: center;
}

.side {
    min-height: 320px;
}

.side::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 60%;
    height: 100%;
    z-index: -1;
    background-image: url('/images/accession-threshold-v2.svg');
    background-size: 90%;
    background-position: center left;
    background-repeat: no-repeat;
}

.section {
    padding: 64px 40px;
    border-top: 1px solid rgb(0 0 0 / 0.08);
    display: grid;
    grid-template-columns: 58% 42%;
    position: relative;
    align-items: center;
}

.section h2 {
    font-size: 50px;
    font-weight: 500;
    line-height: 1.05;
    margin: 0 0 24px;
}

.section p {
    font-size: 24px;
    line-height: 1.4;
    color: #374151;
    max-width: 720px;
}

.cards-wrap {
    padding: 24px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.card {
    padding: 24px;
    border-right: 1px solid var(--border-color);
}

.card:last-child {
    border-right: none;
}

.card h3 {
    font-size: 26px;
    font-family: "Share Tech", sans-serif;
    color: var(--accent);
    margin-top: 0;
}

.card p {
    line-height: 1.5;
}

.final {
    padding: 80px 40px;
    text-align: center;
    border-top: 1px solid rgb(0 0 0 / 0.08);
}

.final h2 {
    font-size: clamp(30px, 3vw, 80px);
    line-height: 0.95;
    letter-spacing: 0;
    margin: 0 0 60px 0;
    font-weight: 700;
}

/* ==========================================================================
   5. PAGES (LOGIN & CONTACT)
   ========================================================================== */
.login-page, .contact-page {   
    height: auto;    
    position: relative;
}

/* Корекция за прелялата опашка на градиента, за да не бута нищо надолу */
.login-page .flow:after, 
.contact-page .flow:after {
    bottom: 0; /* Вместо -300px, за да не излиза под футера */
}

.login-wrap, .contact-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 180px 40px 120px;
    position: relative;
    z-index: 2;
}

.login-box {
    max-width: 560px;
}

.login-title {
    margin: 0 0 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px;
    background: transparent;
    color: inherit;
    border: solid 1px var(--border-color);
    border-radius: 9px;
}

.login-btn {
    width: 100%;
    padding: 18px;
    border: 0;
    cursor: pointer;
    font-size: 16px;
    letter-spacing: .1em;
    margin-top: 10px;
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 20px;
}

.login-links a {
    text-decoration: none;
    color: var(--accent);
}

.contact-box {
    max-width: 900px;
}

.contact-text {
    font-size: clamp(24px, 2vw, 38px);
    color: var(--muted);
    margin-bottom: 48px;
    margin-top: 20px;
}

.contact-email {
    display: inline-block;
    font-size: clamp(24px, 3vw, 42px);
    text-decoration: none;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
footer {
    padding: 40px;
    text-align: center;
    border-top: 1px solid rgb(0 0 0 / 0.08);        
    background: var(--light-accent);

    /* Коректно позициониране на дъното на body */
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}


/* ==========================================================================
   7. RESPONSIVE MEDIA QUERIES (Desktop down)
   ========================================================================== */

@media (min-width: 1800px) {
    .wrap, .story, .section, .nav {
        max-width: 1400px;
    }
    .hero-grid {
        grid-template-columns: 55% 45%;
    }
}

@media (min-width: 1200px) {
    .wrap, .story, .section, .cards-wrap {
        max-width: 1400px;
    }
}

@media (max-width: 1024px) {
    .hero-grid, .story-grid, .section {
        grid-template-columns: 1fr;
    }
    .hero-grid {
        position: relative;
    }
    .mesh {        
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: auto;
        z-index: -1;
    } 
    .mesh svg {
        height: 520px;
    }
    .section h2 {
        font-size: 44px;
    }
    .final h2 {
        font-size: 56px;
    }
    .cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .card {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .card:last-child {
        border-bottom: none;
    }
    .side {
        min-height: 320px;
        position: absolute;
        top: 0;
        width: 100%;
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 18px;
    }
    .nav {
        padding: 18px 20px;
    }
    .brand {
        font-size: 40px;
    }
    .links {
        gap: 16px;
    }
    .links a {      
        font-size: 14px;
    }
    .hero {
        padding-bottom: 0;
    }
    .wrap {
        padding: 110px 20px 0;
    }
    .hero-grid, .story-grid, .section {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .wrap, .story, .section, .cards-wrap, .final {
        width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    .mesh svg {
        height: 360px;
    }
    .flow::after {
        background: transparent;
        bottom: 0;
        left: 0;
    }
    .story {
        padding: 30px 20px 80px;
    }
    .copy {
        font-size: 22px;
    }
    .section h2 {
        font-size: 36px;
    }
    .section p {
        font-size: 18px;
    }
    .cards {
        grid-template-columns: 1fr;
    }
    .card {
        padding: 18px 0;
    }
    .mesh, .side {
        overflow: hidden;
    }
    .final {
        padding: 40px 20px;
    }
    .final h2 {
        font-size: 30px;
        margin: 0 0 40px 0;
    }
    .hero-actions {
        margin: 20px 0;
    }
    .hero-actions a {        
        font-size: 16px;
        padding: 10px 14px;
    }
    .sub {
        font-size: 20px;
    }
    .login-wrap, .contact-wrap {
        padding: 120px 20px 80px;
    }
    .login-links {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .brand {
        font-size: 30px;
    }
    .links {
        gap: 8px;
    }
    .links a {
        font-size: 12px;
        padding: 6px;
    }
    .cta {
        font-size: 16px;
        padding: 10px 14px;
    }
    .sub {
        font-size: 18px;
    }
    .hero-actions a {
        padding: 6px 10px;
        font-size: 16px;
    }
    .copy {
        font-size: 20px;
    }
    .section h2 {
        font-size: 32px;
    }
    .section p {
        font-size: 17px;
        line-height: 1.6;
    }
    .side {
        min-height: 120px;
    }
}