/* ===== Bosh sahifa (index.html) uchun dizayn ===== */

.home-hero {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    min-height: 360px;
    padding: 40px 56px 36px;
    margin-bottom: 36px;
    background: #dbeafe url('../images/home/hero.webp') right center / cover no-repeat;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.10);
}

.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(240, 246, 255, 0.92) 0%,
        rgba(240, 246, 255, 0.75) 35%,
        rgba(240, 246, 255, 0) 60%);
    pointer-events: none;
}

.home-hero-content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.home-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: #1e3a8a;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.home-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
}

.home-hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 54px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1px;
    color: #0b1b3f;
    margin-bottom: 18px;
}

.home-hero h1 span {
    color: #1d6ff2;
}

.home-hero p.lead-text {
    font-size: 16px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 26px;
    max-width: 480px;
}

.home-hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.home-btn.primary {
    background: #1d6ff2;
    color: #fff;
    box-shadow: 0 8px 20px rgba(29, 111, 242, 0.35);
}

.home-btn.primary:hover {
    background: #1559d1;
    color: #fff;
    transform: translateY(-2px);
}

.home-btn.ghost {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.home-btn.ghost:hover {
    background: #fff;
    color: #0f172a;
    transform: translateY(-2px);
}

.home-features {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.home-feature {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.85);
}

.home-feature-icon.orange { color: #f59e0b; background: #fff4dc; }
.home-feature-icon.blue   { color: #1d6ff2; background: #e3eeff; }

.home-feature b {
    display: block;
    font-size: 13px;
    color: #0f172a;
}

.home-feature small {
    font-size: 11px;
    color: #64748b;
}

/* ===== Kalkulyator kartalari ===== */

.home-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.home-card {
    position: relative;
    display: block;
    min-height: 200px;
    padding: 20px 22px 22px;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.home-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

.home-card-img {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 46%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.6) 18%, #000 38%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.6) 18%, #000 38%);
    transition: transform 0.5s ease;
    transform-origin: center right;
}

/* Har bir rasmning asosiy obyekti ko'rinadigan qilib joylash */
.home-card.yellow .home-card-img { object-position: 50% 45%; }
.home-card.red .home-card-img    { object-position: 40% 50%; width: 42%; }
.home-card.blue .home-card-img   { object-position: 70% 25%; }
.home-card.green .home-card-img  { object-position: 75% 55%; }

.home-card:hover .home-card-img {
    transform: scale(1.06);
}

.home-card-body {
    position: relative;
    z-index: 1;
    max-width: 56%;
}

.home-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-bottom: 18px;
}

.home-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.home-card p {
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
    margin-bottom: 16px;
}

.home-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    transition: gap 0.25s ease;
}

.home-card:hover .home-card-btn {
    gap: 12px;
}

/* Rang variantlari */
.home-card.yellow { background: linear-gradient(135deg, #fff8e6 0%, #ffefc7 100%); }
.home-card.yellow .home-card-icon { background: #ffe7a8; color: #d97706; }
.home-card.yellow .home-card-btn  { background: #f5a50b; color: #fff; }

.home-card.red { background: linear-gradient(135deg, #fff1f1 0%, #ffdede 100%); }
.home-card.red .home-card-icon { background: #ef4444; color: #fff; }
.home-card.red .home-card-btn  { background: #ffc9c9; color: #dc2626; }

.home-card.blue { background: linear-gradient(135deg, #eef4ff 0%, #dbe8ff 100%); }
.home-card.blue .home-card-icon { background: #1d6ff2; color: #fff; }
.home-card.blue .home-card-btn  { background: #c4dafd; color: #1d4ed8; }

.home-card.green { background: linear-gradient(135deg, #effbf3 0%, #daf5e3 100%); }
.home-card.green .home-card-icon { background: #fff; color: #16a34a; }
.home-card.green .home-card-btn  { background: #16a34a; color: #fff; }

/* ===== Dark mode ===== */
body.dark-mode .home-hero::before {
    background: linear-gradient(90deg,
        rgba(15, 23, 42, 0.92) 0%,
        rgba(15, 23, 42, 0.75) 38%,
        rgba(15, 23, 42, 0) 65%);
}
body.dark-mode .home-hero h1 { color: #f1f5f9; }
body.dark-mode .home-hero h1 span { color: #60a5fa; }
body.dark-mode .home-hero p.lead-text { color: #cbd5e1; }
body.dark-mode .home-badge,
body.dark-mode .home-btn.ghost { background: rgba(30, 41, 59, 0.9); color: #e2e8f0; }
body.dark-mode .home-feature b { color: #f1f5f9; }
body.dark-mode .home-feature small { color: #94a3b8; }

body.dark-mode .home-card.yellow { background: linear-gradient(135deg, #3a2a06 0%, #4a3408 100%); }
body.dark-mode .home-card.red    { background: linear-gradient(135deg, #3b0d0d 0%, #4c1212 100%); }
body.dark-mode .home-card.blue   { background: linear-gradient(135deg, #0f1f45 0%, #172c5c 100%); }
body.dark-mode .home-card.green  { background: linear-gradient(135deg, #062a1a 0%, #0b3a24 100%); }
body.dark-mode .home-card h3 { color: #f1f5f9; }
body.dark-mode .home-card p  { color: #cbd5e1; }

/* ===== Responsive ===== */
@media (max-width: 1199px) {
    .home-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .home-hero {
        padding: 28px 22px;
        background-position: 70% center;
    }
    .home-hero::before {
        background: linear-gradient(180deg,
            rgba(240, 246, 255, 0.95) 0%,
            rgba(240, 246, 255, 0.85) 70%,
            rgba(240, 246, 255, 0.6) 100%);
    }
    body.dark-mode .home-hero::before {
        background: rgba(15, 23, 42, 0.85);
    }
    .home-hero h1 { font-size: 36px; }
    .home-features { gap: 16px; }
    .home-cards { grid-template-columns: 1fr; }
}

/* ===== Bitta ekran rejimi (scroll yo'q) — katta ekranlar uchun ===== */
@media (min-width: 1200px) and (min-height: 620px) {
    body.home-page {
        overflow: hidden;
        height: 100vh;
    }

    body.home-page .main-content {
        height: 100vh;
        display: flex;
        flex-direction: column;
        padding-top: clamp(12px, 2.2vh, 24px);
        padding-bottom: clamp(12px, 2.2vh, 24px);
    }

    body.home-page .header {
        flex: none;
        margin-bottom: clamp(12px, 2.2vh, 32px);
    }

    /* Hero qolgan bo'sh joyni egallaydi */
    .home-hero {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        align-items: center;
        margin-bottom: clamp(14px, 2.4vh, 32px);
        padding: clamp(20px, 3.5vh, 40px) 56px;
    }

    .home-badge { margin-bottom: clamp(10px, 2vh, 22px); }

    .home-hero h1 {
        font-size: clamp(34px, 5.6vh, 56px);
        margin-bottom: clamp(8px, 1.6vh, 18px);
    }

    .home-hero p.lead-text {
        font-size: clamp(14px, 1.7vh, 16px);
        margin-bottom: clamp(12px, 2.4vh, 26px);
    }

    .home-hero-buttons { margin-bottom: clamp(12px, 3vh, 32px); }

    .home-btn { padding: clamp(9px, 1.4vh, 13px) 22px; }

    body.home-page .section-header {
        flex: none;
        margin-bottom: clamp(10px, 1.6vh, 20px);
    }

    body.home-page .section-header h2 { margin-bottom: 2px; }
    body.home-page .section-header p  { margin-bottom: 0; }

    .home-cards {
        flex: none;
        margin-bottom: 0;
    }

    .home-card {
        min-height: clamp(150px, 21vh, 210px);
        container-type: inline-size;
    }

    /* Karta tor bo'lsa — tavsifni yashirib, sarlavhaga joy beramiz */
    @container (max-width: 260px) {
        .home-card p { display: none; }
        .home-card h3 { margin-bottom: 14px; }
        .home-card-body { max-width: 62%; }
    }
}

/* Past ekranlarda (masalan, noutbuk 1366x768) hero'ni ixchamlash */
@media (min-width: 1200px) and (min-height: 620px) and (max-height: 760px) {
    .home-badge { display: none; }
    .home-feature small { display: none; }
}
