/* AgriConnect — khung dùng chung: header, footer, nút, eyebrow/section-title, cta-band,
   flow ngang, khối placeholder ảnh, card. Từng trang chỉ thêm CSS riêng cho section đặc thù
   của mình (home.css / supply.css / solution.css / pricing.css). */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.ac-page {
    font-family: var(--ac-font);
    color: var(--ac-ink);
    background: var(--ac-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--ac-text-body);
    line-height: 1.6;
}

.ac-page h1,
.ac-page h2,
.ac-page h3,
.ac-page h4 {
    letter-spacing: -0.021em;
    color: var(--ac-ink);
}

.ac-container {
    max-width: var(--ac-container);
    margin: 0 auto;
    padding: 0 var(--ac-gutter);
}

.ac-page section + section {
    border-top: none;
}

/* Bàn phím phải nhìn thấy được mình đang ở đâu — chrome mặc định bị nút bo tròn nuốt mất. */
.ac-page a:focus-visible,
.ac-page button:focus-visible,
.ac-page input:focus-visible,
.ac-page summary:focus-visible {
    outline: 2px solid var(--ac-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .ac-page *,
    .ac-page *::before,
    .ac-page *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Hero (khung dùng chung cho Nguồn cung / Giải pháp / Bảng giá).
     Trang chủ KHÔNG dùng khối này — hero tràn viền riêng nằm trong home.css (.ac-stage*). ---------- */
.ac-hero {
    padding: 56px 0 40px;
    background: linear-gradient(180deg, var(--ac-bg-mint) 0%, #fff 100%);
    overflow: hidden;
}

.ac-hero__grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 48px;
    align-items: center;
}

.ac-hero__title {
    font-size: clamp(1.875rem, 1.3rem + 1.9vw, 2.75rem);
    font-weight: 800;
    line-height: 1.14;
    margin-bottom: 18px;
}

.ac-hero__title .ac-accent {
    color: var(--ac-primary);
}

.ac-hero__desc {
    color: var(--ac-muted);
    font-size: var(--ac-text-lead);
    line-height: 1.62;
    max-width: 52ch;
    margin-bottom: 28px;
}

.ac-hero__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.ac-hero__features {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
}

.ac-hero__feature {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: var(--ac-text-meta);
    font-weight: 600;
    color: var(--ac-ink-soft);
}

.ac-hero__feature i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ac-primary-soft);
    color: var(--ac-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.ac-hero__visual {
    position: relative;
}

.ac-hero__note {
    position: absolute;
    top: -30px;
    right: 4px;
}

@media (max-width: 991px) {
    .ac-hero__grid {
        grid-template-columns: 1fr;
    }

    .ac-hero__visual {
        order: -1;
    }
}

/* ---------- Header ---------- */
.ac-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--ac-border);
}

.ac-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 16px;
}

.ac-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.ac-brand__mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ac-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ac-brand__mark img {
    width: 19px;
    height: 19px;
}

.ac-brand__text {
    line-height: 1.2;
}

.ac-brand__title {
    display: block;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.02em;
    color: var(--ac-primary-dark);
}

.ac-brand__tagline {
    display: block;
    font-size: 11px;
    color: var(--ac-muted);
}

.ac-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.ac-nav a {
    position: relative;
    padding: 9px 14px;
    border-radius: var(--ac-radius-sm);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ac-ink-soft);
    text-decoration: none;
    white-space: nowrap;
}

.ac-nav a:hover {
    background: var(--ac-bg-mint);
    color: var(--ac-primary-dark);
}

.ac-nav a.is-active {
    color: var(--ac-primary-dark);
    font-weight: 700;
}

.ac-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ac-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--ac-border);
    background: var(--ac-white);
    color: var(--ac-muted);
}

.ac-icon-btn:hover {
    border-color: var(--ac-border-strong);
    color: var(--ac-primary-dark);
}

.ac-nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    background: var(--ac-white);
    align-items: center;
    justify-content: center;
}

/* Lối đăng nhập dự phòng trong panel menu — chỉ hiện khi nút ở thanh phải đã bị ẩn. */
.ac-nav__auth {
    display: none !important;
}

/* Nhãn nút header: bản dài cho desktop, bản ngắn cho điện thoại. */
.ac-btn__short {
    display: none;
}

/* ---------- Buttons ---------- */
.ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--ac-radius-pill);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.ac-btn--sm {
    padding: 8px 16px;
    font-size: 13px;
}

.ac-btn--lg {
    padding: 14px 26px;
    font-size: 15px;
}

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

.ac-btn--primary:hover {
    background: var(--ac-primary-dark);
    color: var(--ac-white);
}

.ac-btn--outline {
    background: var(--ac-white);
    border-color: var(--ac-border-strong);
    color: var(--ac-ink);
}

.ac-btn--outline:hover {
    border-color: var(--ac-primary);
    color: var(--ac-primary-dark);
}

/* Nút trên nền ảnh tối */
.ac-btn--ghost-light {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ac-btn--ghost-light:hover {
    background: rgba(255, 255, 255, .22);
    border-color: #fff;
    color: #fff;
}

/* ---------- Nhãn section ---------- */
.ac-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: var(--ac-text-meta);
    font-weight: 600;
    letter-spacing: 0;
    color: var(--ac-primary-dark);
    margin-bottom: 14px;
}

.ac-eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--ac-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.ac-section-title {
    font-size: var(--ac-text-h2);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
}

.ac-section-desc {
    font-size: var(--ac-text-lead);
    line-height: 1.62;
    color: var(--ac-muted);
    max-width: 62ch;
}

.ac-section {
    padding: 76px 0;
}

.ac-section--mint {
    background: var(--ac-bg-mint);
}

/* ---------- Cards ---------- */
.ac-card {
    background: var(--ac-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow-sm);
}

/* ---------- Flow ngang (nhiều bước nối bằng mũi tên) ---------- */
.ac-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.ac-flow__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 96px;
    text-align: center;
}

.ac-flow__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--ac-primary-soft);
    color: var(--ac-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ac-flow__label {
    font-size: var(--ac-text-meta);
    font-weight: 600;
    color: var(--ac-ink);
}

.ac-flow__arrow {
    color: var(--ac-border-strong);
    font-size: 18px;
    flex-shrink: 0;
}

/* ---------- Khối chờ ảnh (placeholder) ---------- */
.ac-img-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--ac-bg-mint);
    border: 2px dashed var(--ac-border-strong);
    border-radius: var(--ac-radius);
    color: var(--ac-muted);
    font-size: var(--ac-text-meta);
    line-height: 1.5;
    padding: 16px;
    overflow: hidden;
}

.ac-img-slot__hint {
    max-width: 220px;
}

.ac-img-slot__hint b {
    display: block;
    color: var(--ac-primary-dark);
    font-size: var(--ac-text-body);
    margin-bottom: 2px;
}

/* Khối chờ ảnh cố gắng nạp ảnh thật tại đúng path (mỗi view đặt <img src="..."
   onerror="this.remove()"> ngay trong khối). Ảnh chưa tồn tại → gỡ khỏi DOM, lộ khối gợi ý
   phía sau. Ảnh đã có → phủ kín khối, che khối gợi ý — không cần sửa lại HTML/CSS. */
.ac-img-slot > img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.ac-img-slot:has(> img) {
    border: none;
}

.ac-img-slot--round {
    border-radius: 50%;
}

/* ---------- CTA band cuối trang ---------- */
.ac-cta-band {
    position: relative;
    background: linear-gradient(135deg, var(--ac-bg-mint-2), var(--ac-bg-mint));
    border-radius: var(--ac-radius-lg);
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
}

.ac-cta-band__title {
    font-size: clamp(1.25rem, 1.05rem + .8vw, 1.75rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 8px;
    max-width: 22ch;
}

.ac-cta-band__desc {
    font-size: var(--ac-text-body);
    line-height: 1.6;
    color: var(--ac-muted);
    max-width: 56ch;
}

.ac-cta-band__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Biến thể nền ảnh: dùng khi truyền ImageUrl vào partial Landing/_CtaBand. */
.ac-cta-band--photo {
    overflow: hidden;
    background: var(--ac-primary-dark);
    padding: 64px 52px;
    box-shadow: var(--ac-shadow-lg);
}

.ac-cta-band--photo .ac-cta-band__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Nút phụ (viền trắng) nằm ở nửa phải băng, mà ảnh cảng lại sáng nhất đúng chỗ đó — nên lớp phủ
   giữ mức tối tối thiểu trên toàn bộ băng chứ không tan dần về trong suốt. */
.ac-cta-band--photo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(100deg, rgba(8, 40, 24, .94) 0%, rgba(8, 40, 24, .88) 40%, rgba(8, 40, 24, .76) 72%, rgba(8, 40, 24, .68) 100%);
}

.ac-cta-band--photo > *:not(.ac-cta-band__bg) {
    position: relative;
    z-index: 2;
}

.ac-cta-band--photo .ac-cta-band__title {
    color: #fff;
}

.ac-cta-band--photo .ac-cta-band__desc {
    color: rgba(255, 255, 255, .82);
}

.ac-cta-band--photo .ac-btn--outline {
    background: transparent;
    border-color: rgba(255, 255, 255, .5);
    color: #fff;
}

.ac-cta-band--photo .ac-btn--outline:hover {
    background: rgba(255, 255, 255, .14);
    border-color: #fff;
    color: #fff;
}

.ac-note-script {
    position: absolute;
    top: -14px;
    right: 32px;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--ac-primary-dark);
    opacity: .55;
    font-size: var(--ac-text-meta);
    text-align: right;
    display: none;
}

@media (min-width: 992px) {
    .ac-note-script {
        display: block;
    }
}

/* ---------- Footer ---------- */
.ac-footer {
    border-top: 1px solid var(--ac-border);
    background: var(--ac-bg-mint);
    padding: 40px 0;
}

.ac-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.ac-footer__links {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    font-size: 14px;
}

.ac-footer__links a {
    color: var(--ac-muted);
    text-decoration: none;
}

.ac-footer__links a:hover {
    color: var(--ac-primary-dark);
}

.ac-footer__social {
    display: flex;
    gap: 10px;
}

.ac-footer__social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--ac-border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ac-muted);
    text-decoration: none;
}

.ac-footer__social a:hover {
    border-color: var(--ac-primary);
    color: var(--ac-primary-dark);
}

.ac-footer__meta {
    font-size: var(--ac-text-meta);
    line-height: 1.6;
    color: var(--ac-muted);
    text-align: right;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .ac-nav {
        position: fixed;
        inset: 72px 0 0 0;
        background: var(--ac-white);
        flex-direction: column;
        align-items: stretch;
        padding: 12px 24px;
        gap: 2px;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease;
        z-index: 39;
        overflow-y: auto;
    }

    .ac-nav.is-open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .ac-nav a {
        padding: 13px 10px;
        border-bottom: 1px solid var(--ac-border);
    }

    .ac-nav-toggle {
        display: inline-flex;
    }

    .ac-header__actions .ac-btn--outline,
    .ac-header__actions .ac-icon-btn {
        display: none;
    }

    .ac-nav__auth {
        display: block !important;
        color: var(--ac-primary-dark);
        font-weight: 700;
    }
}

@media (max-width: 767px) {
    /* Các <br /> trong tiêu đề section được đặt cho khổ rộng; ở khổ hẹp chúng cắt câu giữa
       chừng rồi để lại dòng cụt ("...một chuỗi / xác thực,"). Cho chữ tự xuống dòng.
       Riêng tiêu đề hero giữ nguyên vì mỗi dòng ở đó là một câu trọn vẹn. */
    .ac-section-title br,
    .ac-band__title br {
        display: none;
    }

    /* Thu gọn header cho vừa 390px: bỏ tagline, rút nhãn nút, siết padding. */
    .ac-header__inner {
        gap: 10px;
    }

    .ac-brand__tagline {
        display: none;
    }

    .ac-header__actions .ac-btn {
        padding: 9px 15px;
        font-size: 13px;
    }

    .ac-btn__long {
        display: none;
    }

    .ac-btn__short {
        display: inline;
    }

    .ac-section {
        padding: 52px 0;
    }

    .ac-cta-band {
        padding: 32px 24px;
    }

    .ac-cta-band--photo {
        padding: 40px 26px;
    }

    .ac-footer__inner {
        justify-content: flex-start;
    }

    .ac-footer__meta {
        text-align: left;
    }
}
