/* ==========================================================================
   Home page (index.html) — loaded only there, after style.css.
   Same visual language as profile.css / admin.css.
   ========================================================================== */

.home {
    --h-bg: #ffffff;
    --h-tint: #f3f5f4;
    --h-surface: #ffffff;
    --h-surface-2: #f6f8f7;
    --h-border: #e1e7e3;
    --h-text: #1c2a23;
    --h-muted: #5f6f66;
    --h-primary: #25583c;
    --h-primary-hover: #1d4730;
    --h-primary-soft: #e6f1ea;
    --h-on-primary: #ffffff;
    --h-good: #1e7a46;
    --h-good-soft: #e3f4ea;
    --h-warn: #a85800;
    --h-warn-soft: #fff1dc;
    --h-radius: 18px;
    --h-shadow: 0 1px 2px rgba(16, 24, 20, 0.04), 0 8px 24px rgba(16, 24, 20, 0.07);
    --h-focus: 0 0 0 3px rgba(37, 88, 60, 0.3);

    flex: 1;
    width: 100%;
    background: var(--h-bg);
    color: var(--h-text);
    font-size: 16px;
    line-height: 1.6;
}

body.dark-mode .home {
    --h-bg: #141816;
    --h-tint: #191e1b;
    --h-surface: #1f2522;
    --h-surface-2: #252c28;
    --h-border: #2f3833;
    --h-text: #e7eee9;
    --h-muted: #a3b1a8;
    --h-primary: #5fb878;
    --h-primary-hover: #74c88b;
    --h-primary-soft: #21352a;
    --h-on-primary: #0f1a14;
    --h-good: #6fd394;
    --h-good-soft: #1d3527;
    --h-warn: #f2b45a;
    --h-warn-soft: #3a2b14;
    --h-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --h-focus: 0 0 0 3px rgba(95, 184, 120, 0.4);
}

/* Neutralise site-wide element styles (section, h1–h3, p) */
.home section {
    display: block; padding: 0; min-height: 0;
    text-align: left; align-items: initial; flex: none;
    background: transparent;
}
.home h1, .home h2, .home h3 { margin: 0; font-family: 'Montserrat', 'Open Sans', sans-serif; color: inherit; }
.home p { max-width: none; font-size: inherit; margin: 0; }
.home ul, .home ol { margin: 0; padding: 0; list-style: none; }
.home-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.home-wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.home-wrap--narrow { max-width: 820px; }

/* --- Buttons -------------------------------------------------------------- */
.home-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 24px;
    border-radius: 12px;
    border: 2px solid transparent;
    font-weight: 700; font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.home-btn:focus-visible { outline: none; box-shadow: var(--h-focus); }
.home-btn:hover .home-icon { transform: translateX(3px); }
.home-btn .home-icon { transition: transform 0.15s; }
.home-btn--primary { background: var(--h-primary); color: var(--h-on-primary); }
.home-btn--primary:hover { background: var(--h-primary-hover); color: var(--h-on-primary); }

/* --- Sections ------------------------------------------------------------- */
.home .home-section { padding: 72px 0; }
.home .home-section--tint { background: var(--h-tint); }
.home-section__head { max-width: 720px; margin: 0 auto 36px; text-align: center; }
.home-kicker { color: var(--h-primary); font-size: 0.8rem !important; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px !important; }
.home .home-section__title { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; color: var(--h-text); }
.home-section__sub { color: var(--h-muted); margin-top: 10px !important; }

/* Offers */
.home-offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 960px; margin: 0 auto; }
.home-offer {
    display: flex; flex-direction: column; gap: 16px;
    padding: 30px 28px;
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
}
.home-offer--featured { border: 2px solid var(--h-primary); }
/* Heading and tag always share one line: the heading wraps its own words,
   the tag keeps its size on the right */
.home-offer__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
.home-offer__top h2 { flex: 1 1 auto; min-width: 0; font-size: 1.35rem; line-height: 1.25; color: var(--h-text); }
.home-offer__top .home-tag { flex-shrink: 0; }
.home-offer__lead { color: var(--h-muted); }
.home-offer__note { font-size: 0.85rem !important; color: var(--h-muted); padding: 10px 12px; border-radius: 10px; background: var(--h-surface-2); }
.home-offer .home-btn { margin-top: auto; align-self: stretch; }

.home-tag { padding: 5px 14px; border-radius: 999px; background: var(--h-primary); color: var(--h-on-primary); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
.home-tag--free { background: var(--h-good-soft); color: var(--h-good); }

/* "Bez maksas" — loud on purpose: bright green, glow, gift icon, soft shine */
.home-tag--loud {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px 7px 12px;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #2bb36a, #1e7a46);
    box-shadow: 0 0 0 3px rgba(43, 179, 106, 0.22), 0 6px 16px rgba(30, 122, 70, 0.35);
    animation: freePulse 2.4s ease-in-out infinite;
}
.home-tag--loud::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='8' width='18' height='4' rx='1'/%3E%3Cpath d='M12 8v13M5 12v9h14v-9M7.5 8a2.5 2.5 0 0 1 0-5C10 3 12 8 12 8s2-5 4.5-5a2.5 2.5 0 0 1 0 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.home-tag--loud::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    animation: freeShine 3.2s ease-in-out infinite;
}
/* the free card gets a matching green accent */
.home-offer:has(.home-tag--loud) {
    border: 2px solid #2bb36a;
    background: linear-gradient(180deg, rgba(43, 179, 106, 0.08), transparent 140px), var(--h-surface);
}
body.dark-mode .home-tag--loud { box-shadow: 0 0 0 3px rgba(43, 179, 106, 0.28), 0 6px 18px rgba(0, 0, 0, 0.45); }

@keyframes freePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}
@keyframes freeShine {
    0%, 55% { left: -60%; }
    100%    { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
    .home-tag--loud, .home-tag--loud::after { animation: none; }
}

.home-checks { display: flex; flex-direction: column; gap: 10px; }
.home-checks li { position: relative; padding-left: 30px; }
.home-checks li::before {
    content: '';
    position: absolute; left: 0; top: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--h-primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2325583c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.home-disclaimer { max-width: 960px !important; margin: 20px auto 0 !important; font-size: 0.82rem !important; color: var(--h-muted); text-align: center; }

/* Topics */
.home-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.home-topics li {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--h-surface-2);
    border: 1px solid var(--h-border);
    font-weight: 600; font-size: 0.95rem; line-height: 1.35;
}
.home-topics li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--h-primary); flex-shrink: 0; }

/* Resources */
.home-resources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.home-resource {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 20px;
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
    color: var(--h-text);
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s;
}
.home-resource:hover { transform: translateY(-3px); border-color: var(--h-primary); color: var(--h-text); }
.home-resource:focus-visible { outline: none; box-shadow: var(--h-focus); }
.home-resource__icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--h-primary-soft); color: var(--h-primary); }
.home-resource__text { display: flex; flex-direction: column; gap: 2px; }
.home-resource__text strong { font-size: 1.05rem; }
.home-resource__text span { color: var(--h-muted); font-size: 0.92rem; line-height: 1.45; }

/* News (cards rendered by src/script.js) */
.home .news-container { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: none; margin: 0; }
.home .news-container > p { grid-column: 1 / -1; text-align: center; color: var(--h-muted); }
.home .news-item {
    display: flex; flex-direction: column; align-items: stretch;
    max-width: none; min-width: 0;
    padding: 0;
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
    color: var(--h-text);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.home .news-item:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.12); }
.home .news-item:focus-visible { outline: none; box-shadow: var(--h-focus); }
.home .news-item img { width: 100%; height: 190px; margin: 0; border-radius: 0; object-fit: cover; background: var(--h-surface-2); }
.news-item__body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; flex: 1; }
.news-item__date { color: var(--h-muted); font-size: 0.82rem; font-weight: 600; }
.home .news-item h3 { font-size: 1.08rem; line-height: 1.35; color: var(--h-text); }
.news-item__more { margin-top: auto; padding-top: 6px; color: var(--h-primary); font-weight: 700; font-size: 0.9rem; }
.home .news-pagination { margin-top: 28px; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 960px) {
    .home-resources { grid-template-columns: minmax(0, 1fr); }
    .home .news-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .home-wrap { padding: 0 16px; }
    .home .home-section { padding: 52px 0; }
    .home-section__head { margin-bottom: 26px; }
    .home-offers { grid-template-columns: minmax(0, 1fr); }
    .home-offer { padding: 24px 20px; }
    .home .news-container { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .home-btn, .home-btn .home-icon, .home-resource, .home .news-item, .home-info { transition: none; }
}

/* --- First section (page now starts with the offers) ---------------------- */
.home .home-section--first { padding-top: 56px; }
.home .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* (i) info button next to "Mācību materiāli" */
.home-offer__title { display: inline-flex; align-items: center; gap: 8px; }
.home-info {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px;
    padding: 0;
    border: 1px solid var(--h-border);
    border-radius: 50%;
    background: var(--h-primary-soft);
    color: var(--h-primary);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.home-info .home-icon { width: 18px; height: 18px; }
.home-info:hover { background: var(--h-primary); color: var(--h-on-primary); border-color: var(--h-primary); }
.home-info:focus-visible { outline: none; box-shadow: var(--h-focus); }

/* Topics popup */
.home-dialog {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: var(--h-surface);
    color: var(--h-text);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.home-dialog::backdrop { background: rgba(10, 20, 15, 0.55); backdrop-filter: blur(2px); }
.home-dialog[open] { animation: home-dialog-in 0.18s ease-out; }
@keyframes home-dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.home-dialog__panel { padding: 26px 26px 28px; }
.home-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.home-dialog h2 { font-size: 1.5rem; line-height: 1.2; color: var(--h-text); }
.home-dialog__sub { color: var(--h-muted); margin-bottom: 18px !important; }
.home-dialog__close {
    display: grid; place-items: center;
    width: 38px; height: 38px; flex-shrink: 0;
    border: 1px solid var(--h-border); border-radius: 50%;
    background: var(--h-surface-2); color: var(--h-text);
    cursor: pointer;
}
.home-dialog__close:hover { background: var(--h-primary-soft); color: var(--h-primary); }
.home-dialog__close:focus-visible { outline: none; box-shadow: var(--h-focus); }
.home-dialog .home-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 640px) {
    .home .home-section--first { padding-top: 36px; }
    .home-dialog__panel { padding: 20px 18px 22px; }
    .home-dialog .home-topics { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .home-dialog[open] { animation: none; }
}

/* ==========================================================================
   Exam selection screen (eksamens.php) — sits on the green #tests background
   ========================================================================== */
.home.exam-home { background: transparent; color: var(--h-text); flex: none; text-align: left; }
.exam-loading { text-align: center; color: #fff; font-weight: 600; padding: 40px 0; }

.exam-home__head { margin-bottom: 24px; }
.exam-home__head .home-kicker { color: rgba(255, 255, 255, 0.85); }
.home .exam-home__head .home-section__title { color: #fff; }
.exam-home__head .home-section__sub { color: rgba(255, 255, 255, 0.88); }

/* Rules strip */
.exam-rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 960px; margin: 0 auto 24px !important; }
.exam-rules li {
    display: flex; flex-direction: column; gap: 2px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}
.exam-rules strong { font-family: 'Montserrat', sans-serif; font-size: 1.4rem; line-height: 1.1; }
.exam-rules span { font-size: 0.85rem; line-height: 1.35; opacity: 0.9; }

.exam-home #exam-token-message { max-width: 960px; margin: 0 auto 20px; box-sizing: border-box; }
.exam-home .home-offer { text-align: left; }
.exam-home .home-offer .home-btn { width: 100%; }

.exam-home__more { text-align: center; color: rgba(255, 255, 255, 0.9); margin-top: 22px !important; }
.exam-home__more a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
    .exam-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .exam-rules li { padding: 12px; }
    .exam-rules strong { font-size: 1.2rem; }
}

/* --- Whole offer card is clickable (index.html, eksamens.php) -------------
   The card's main button gets an invisible layer stretched over the entire
   card, so a click anywhere triggers it. Keyboard users still tab to the one
   real button; the (i) info button sits above the layer. */
.home-offer { position: relative; cursor: pointer; transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s; }
.home-offer .home-btn--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--h-radius);
}
.home-offer .home-info { position: relative; z-index: 2; }
.home-offer:hover { transform: translateY(-4px); border-color: var(--h-primary); box-shadow: 0 18px 40px rgba(16, 24, 20, 0.14); }
.home-offer:hover .home-btn--primary { background: var(--h-primary-hover); }
.home-offer:has(.home-btn--primary:focus-visible) { border-color: var(--h-primary); box-shadow: var(--h-focus), var(--h-shadow); }
@media (prefers-reduced-motion: reduce) {
    .home-offer { transition: none; }
    .home-offer:hover { transform: none; }
}

/* --- Mācību materiāli (hunter.php) ---------------------------------------
   These cards contain dropdowns, so they are NOT whole-card clickable. */
/* No full-card layer (it would block the dropdowns); a click handler in
   src/script.js starts the test instead. The dropdown area keeps a normal cursor. */
.home-offer--form .home-btn--primary::before { display: none; }
.home-offer--form .hunter-field { cursor: default; }

.hunter-field { display: flex; flex-direction: column; gap: 6px; }
.hunter-field label { font-weight: 700; font-size: 0.88rem; color: var(--h-text); }
.home .hunter-select {
    width: 100%;
    margin: 0;
    padding: 12px 40px 12px 14px;
    border: 1px solid var(--h-border);
    border-radius: 12px;
    background: var(--h-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366766d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center / 18px no-repeat;
    color: var(--h-text);
    font: inherit; font-size: 0.95rem;
    appearance: none; -webkit-appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.home .hunter-select:hover { border-color: var(--h-muted); }
.home .hunter-select:focus { outline: none; border-color: var(--h-primary); box-shadow: var(--h-focus); }
.hunter-field__error { color: #d32f2f; font-size: 0.85rem !important; font-weight: 700; }
body.dark-mode .hunter-field__error { color: #ff6b6b; }

.home-resources.hunter-resources { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 960px; margin: 24px auto 0; }
@media (max-width: 760px) {
    .home-resources.hunter-resources { grid-template-columns: minmax(0, 1fr); }
}

/* --- Custom dropdown (enhanceSelect in src/script.js) --------------------- */
.fancy-select { position: relative; }
.fancy-select__native {
    position: absolute !important; width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important; overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important; border: 0 !important; opacity: 0;
}
.fancy-select__button {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%;
    padding: 13px 14px 13px 16px;
    border: 1px solid var(--h-border);
    border-radius: 12px;
    background: var(--h-surface);
    color: var(--h-text);
    font: inherit; font-size: 0.97rem; font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.fancy-select__button:hover { border-color: var(--h-muted); }
.fancy-select__button:focus-visible,
.fancy-select.is-open .fancy-select__button { outline: none; border-color: var(--h-primary); box-shadow: var(--h-focus); }
.fancy-select__button.is-placeholder .fancy-select__value { color: var(--h-muted); font-weight: 500; }
.fancy-select__button.is-invalid { border-color: #d32f2f; box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.18); }
.fancy-select__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fancy-select__chevron {
    width: 18px; height: 18px; flex-shrink: 0;
    fill: none; stroke: var(--h-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.18s;
}
.fancy-select.is-open .fancy-select__chevron { transform: rotate(180deg); stroke: var(--h-primary); }

.fancy-select__list {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px);
    z-index: 30;
    max-height: 320px;
    overflow-y: auto;
    margin: 0 !important; padding: 6px !important;
    list-style: none;
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(16, 24, 20, 0.18);
    overscroll-behavior: contain;
    animation: fancy-select-in 0.14s ease-out;
}
.fancy-select__list:focus { outline: none; }
@keyframes fancy-select-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.fancy-select__option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--h-text);
    cursor: pointer;
    line-height: 1.3;
}
.fancy-select__option.is-active { background: var(--h-primary-soft); }
.fancy-select__option[aria-selected="true"] { color: var(--h-primary); font-weight: 700; }
.fancy-select__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fancy-select__name { font-size: 0.93rem; }
.fancy-select__desc { color: var(--h-muted); font-size: 0.8rem; font-weight: 500; }
.fancy-select__badge {
    flex-shrink: 0;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--h-surface-2);
    border: 1px solid var(--h-border);
    color: var(--h-muted);
    font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}
.fancy-select__option.is-active .fancy-select__badge { background: var(--h-surface); }
.fancy-select__check {
    width: 18px; height: 18px; flex-shrink: 0;
    fill: none; stroke: var(--h-primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
    visibility: hidden;
}
.fancy-select__option[aria-selected="true"] .fancy-select__check { visibility: visible; }

@media (max-width: 640px) {
    .fancy-select__list { max-height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
    .fancy-select__list { animation: none; }
    .fancy-select__chevron, .fancy-select__button { transition: none; }
}
/* A card with an open dropdown stays above its neighbours (and doesn't lift) */
.home-offer:has(.fancy-select.is-open) { z-index: 40; transform: none; }

/* ==========================================================================
   Contacts page (kontakti.html)
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; max-width: 1040px; margin: 0 auto; align-items: start; }
.contact-card, .contact-details, .contact-about {
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
}
.contact-card { padding: 28px; }
.home .contact-card__title { font-size: 1.2rem; color: var(--h-text); margin-bottom: 16px; }

.contact-form-modern { display: flex; flex-direction: column; gap: 16px; }
.contact-form-modern__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.contact-field label { font-weight: 700; font-size: 0.88rem; color: var(--h-text); }
.contact-field input, .contact-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--h-border);
    border-radius: 12px;
    background: var(--h-surface);
    color: var(--h-text);
    font: inherit; font-size: 0.97rem;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-field textarea { resize: vertical; min-height: 150px; }
.contact-field input::placeholder, .contact-field textarea::placeholder { color: var(--h-muted); opacity: 0.8; }
.contact-field input:hover, .contact-field textarea:hover { border-color: var(--h-muted); }
.contact-field input:focus, .contact-field textarea:focus { outline: none; border-color: var(--h-primary); box-shadow: var(--h-focus); }
.contact-form-modern__note { color: var(--h-muted); font-size: 0.85rem !important; }
.contact-form-modern .home-btn { align-self: flex-start; }
.contact-form-modern .home-btn:disabled { opacity: 0.6; cursor: wait; }

/* Send result (created by src/script.js) */
.contact-alert { padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 0.92rem; border: 1px solid transparent; }
.contact-alert--success { background: var(--h-good-soft); color: var(--h-good); border-color: color-mix(in srgb, var(--h-good) 30%, transparent); }
.contact-alert--error { background: #fdecea; color: #c62828; border-color: rgba(198, 40, 40, 0.3); }
body.dark-mode .contact-alert--error { background: #3d1e1b; color: #ff6b6b; }

.contact-side { display: flex; flex-direction: column; gap: 14px; }
.contact-side .home-resource__text span { overflow-wrap: anywhere; }
.contact-details { padding: 22px; }
.contact-details dl { margin: 0; display: flex; flex-direction: column; }
.contact-details dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--h-border); }
.contact-details dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-details dt { color: var(--h-muted); font-size: 0.85rem; font-weight: 600; flex-shrink: 0; }
.contact-details dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.contact-about { max-width: 1040px; margin: 24px auto 0; padding: 26px 28px; box-sizing: border-box; }
.contact-about p { color: var(--h-muted); }
.contact-about p + p { margin-top: 10px !important; }

@media (max-width: 860px) {
    .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .contact-card { padding: 20px 18px; }
    .contact-form-modern__row { grid-template-columns: minmax(0, 1fr); }
    .contact-form-modern .home-btn { align-self: stretch; }
    .contact-about { padding: 20px 18px; }
}

/* ==========================================================================
   Noderīgi (noderigi.html) — link cards in two columns
   ========================================================================== */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.links-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1040px; margin: 0 auto; }

.link-card {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding: 18px 20px;
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: 16px;
    box-shadow: var(--h-shadow);
    color: var(--h-text);
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.link-card:hover { transform: translateY(-3px); border-color: var(--h-primary); box-shadow: 0 14px 30px rgba(16, 24, 20, 0.12); color: var(--h-text); }
.link-card:focus-visible { outline: none; box-shadow: var(--h-focus); }
.link-card__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.link-card__text strong { font-size: 1rem; line-height: 1.3; }
.link-card__full { color: var(--h-muted); font-size: 0.84rem; line-height: 1.4; }
.link-card__src { margin-top: 4px; color: var(--h-primary); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }
.link-card__ext { color: var(--h-muted); width: 18px; height: 18px; margin-top: 2px; transition: color 0.15s, transform 0.15s; }
.link-card:hover .link-card__ext { color: var(--h-primary); transform: translate(2px, -2px); }


@media (max-width: 640px) {
    .links-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .link-card, .link-card__ext { transition: none; }
}

/* --- Noderīgi dokumenti (noderigi-dokumenti.php) -------------------------- */
.docs-back {
    display: inline-flex; align-items: center; gap: 4px;
    margin-bottom: 14px;
    padding: 4px 12px 4px 8px;
    border-radius: 999px;
    background: var(--h-primary-soft);
    color: var(--h-primary);
    font-size: 0.85rem; font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.docs-back .home-icon { width: 16px; height: 16px; }
.docs-back:hover { background: var(--h-primary); color: var(--h-on-primary); }
.docs-back:focus-visible { outline: none; box-shadow: var(--h-focus); }

.doc-card { align-items: center; }
.doc-card .link-card__text { flex: 1; }
.doc-card__icon {
    display: grid; place-items: center;
    width: 52px; height: 60px;
    flex-shrink: 0;
    border-radius: 8px 16px 8px 8px;
    background: #2b579a;
    color: #fff;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}
.doc-card:hover .link-card__ext { transform: translateY(2px); }

/* --- Mācību video (macibu-materiali.php) ---------------------------------- */
.vid-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 1100px; margin: 0 auto; }
.vid-card {
    display: flex; flex-direction: column;
    width: 100%;
    padding: 0;
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
    overflow: hidden;
    color: var(--h-text);
    font: inherit; text-align: left;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.vid-card:hover { transform: translateY(-4px); border-color: var(--h-primary); box-shadow: 0 18px 40px rgba(16, 24, 20, 0.14); }
.vid-card:focus-visible { outline: none; box-shadow: var(--h-focus); }

/* YouTube preview image with a play button on top */
.vid-card__thumb {
    position: relative;
    display: grid; place-items: center;
    aspect-ratio: 16 / 9;
    background-color: #1c2a23;
    background-size: cover; background-position: center;
}
.vid-card__thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.35)); transition: background-color 0.18s; }
.vid-card__play {
    position: relative; z-index: 1;
    display: grid; place-items: center;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.18s, background-color 0.18s;
}
.vid-card__play svg { width: 24px; height: 24px; margin-left: 3px; fill: #25583c; }
.vid-card:hover .vid-card__play { transform: scale(1.08); background: #fff; }

.vid-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.vid-card__body strong { font-size: 1.05rem; line-height: 1.3; }
.vid-card__body span { color: var(--h-muted); font-size: 0.9rem; line-height: 1.5; }

@media (max-width: 960px) {
    .vid-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .vid-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .vid-card, .vid-card__play { transition: none; }
    .vid-card:hover { transform: none; }
}

/* Kontakti, PC: the right column (e-mail, phone, details) is exactly as tall as
   the form card; the three boxes share the extra height evenly */
@media (min-width: 861px) {
    .contact-grid { align-items: stretch; }
    .contact-side > * { flex: 1 1 0; }
    .contact-side .home-resource { align-items: center; }
    .contact-side .contact-details { display: flex; flex-direction: column; justify-content: center; }
}

/* ==========================================================================
   Piekļuve (access.php)
   ========================================================================== */
/* Cards with forms: no whole-card click, no lift */
.home-offer.home-offer--plain { cursor: default; }
.home-offer--plain .home-btn--primary::before { display: none; }
.home-offer.home-offer--plain:hover { transform: none; box-shadow: var(--h-shadow); }
.home-offer--plain:not(.home-offer--featured):hover { border-color: var(--h-border); }
.home-offer--featured.home-offer--plain:hover { border-color: var(--h-primary); }
.home-offer--plain:hover .home-btn--primary { background: var(--h-primary); }
.home-offer--plain .home-btn--primary:hover { background: var(--h-primary-hover); }

.access-benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 960px; margin: 0 auto 24px !important; }
.access-benefits li {
    display: flex; flex-direction: column; gap: 3px;
    padding: 14px 16px;
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: 14px;
}
.access-benefits strong { color: var(--h-primary); font-size: 1rem; }
.access-benefits span { color: var(--h-muted); font-size: 0.85rem; line-height: 1.4; }

.access-alert {
    max-width: 960px; margin: 0 auto 20px; box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fdecea; color: #c62828; border: 1px solid rgba(198, 40, 40, 0.3);
    font-weight: 600; font-size: 0.93rem;
}
.access-alert--success { background: var(--h-good-soft); color: var(--h-good); border-color: color-mix(in srgb, var(--h-good) 30%, transparent); }
body.dark-mode .access-alert:not(.access-alert--success) { background: #3d1e1b; color: #ff6b6b; }

.access-form { display: flex; flex-direction: column; gap: 16px; margin: auto 0 0; }
.access-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--h-border);
    border-radius: 12px;
    background: var(--h-surface);
    color: var(--h-text);
    font: inherit; font-size: 1rem; font-weight: 600; letter-spacing: 0.06em;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.access-input::placeholder { color: var(--h-muted); font-weight: 400; opacity: 0.8; }
.access-input:hover { border-color: var(--h-muted); }
.access-input:focus { outline: none; border-color: var(--h-primary); box-shadow: var(--h-focus); }
.access-form .home-btn { width: 100%; }

.access-more { text-align: center; color: var(--h-muted); margin-top: 22px !important; }
.access-more a { color: var(--h-primary); font-weight: 700; }

@media (max-width: 860px) {
    .access-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Checkout (forma.php) — the checkout script toggles .form-step.active and
   .progress-step.active; these rules only restyle, never change that logic.
   ========================================================================== */
.co-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; max-width: 1040px; margin: 0 auto; align-items: start; }

/* Step indicator */
.checkout-modern .co-steps { display: flex; max-width: 420px; margin: 0 auto 26px; }
.checkout-modern .progress-step:not(:last-child)::after { top: 19px; background-color: var(--h-border); }
.checkout-modern .progress-circle {
    width: 38px; height: 38px; margin: 0 auto 8px;
    background: var(--h-surface-2); border: 2px solid var(--h-border); color: var(--h-muted);
    font-size: 0.95rem;
}
.checkout-modern .progress-label { color: var(--h-muted); font-size: 0.85rem; font-weight: 600; }
.checkout-modern .progress-step.active .progress-circle { background: var(--h-primary); border-color: var(--h-primary); color: var(--h-on-primary); box-shadow: 0 0 0 4px var(--h-primary-soft); }
.checkout-modern .progress-step.active .progress-label { color: var(--h-primary); }
/* Step 1 shows as done (check mark) while step 2 is active */
.checkout-modern .co-steps:has(#step2-indicator.active) #step1-indicator .progress-circle { background: var(--h-primary-soft); border-color: var(--h-primary); color: transparent; }
.checkout-modern .co-steps:has(#step2-indicator.active) #step1-indicator .progress-circle::after { content: '\2713'; position: absolute; color: var(--h-primary); font-weight: 800; }
.checkout-modern .co-steps:has(#step2-indicator.active) #step1-indicator::after { background-color: var(--h-primary); }

.home .checkout-modern .step-title { margin: 0 0 18px; font-size: 1.2rem; text-align: left; color: var(--h-text); }

/* Private / company: segmented control */
.checkout-modern .co-segment {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
    margin: 0 0 20px; padding: 4px;
    border-radius: 12px; background: var(--h-surface-2); border: 1px solid var(--h-border);
}
.checkout-modern .co-segment .radio-label {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 10px 12px; border-radius: 9px;
    color: var(--h-muted); font-weight: 700; font-size: 0.92rem;
    cursor: pointer; transition: background-color 0.15s, color 0.15s;
}
.checkout-modern .co-segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkout-modern .co-segment .radio-label:has(input:checked) { background: var(--h-surface); color: var(--h-primary); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.checkout-modern .co-segment .radio-label:has(input:focus-visible) { box-shadow: var(--h-focus); }

/* Fields */
.checkout-modern .co-form .form-group { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; min-width: 0; }
.checkout-modern .co-form .form-group > label { margin: 0; font-weight: 700; font-size: 0.88rem; color: var(--h-text); }
.checkout-modern .co-form .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.checkout-modern .co-form .form-row:has(.flex-2) { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.checkout-modern .co-form .form-group input[type="text"],
.checkout-modern .co-form .form-group input[type="email"],
.checkout-modern .co-form .form-group input[type="tel"] {
    width: 100%; margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--h-border); border-radius: 12px;
    background: var(--h-surface); color: var(--h-text);
    font: inherit; font-size: 0.97rem;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.checkout-modern .co-form .form-group input:hover { border-color: var(--h-muted); }
.checkout-modern .co-form .form-group input:focus { outline: none; border-color: var(--h-primary); box-shadow: var(--h-focus); transform: none; }

.checkout-modern .co-terms { margin-top: 4px !important; }
.checkout-modern .co-terms .checkbox-label { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 0.92rem; line-height: 1.45; cursor: pointer; }
.checkout-modern .co-terms input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--h-primary); }
.checkout-modern .co-terms a { color: var(--h-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Buttons */
.checkout-modern .co-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.checkout-modern .co-actions .home-btn--primary { flex: 2 1 220px; }
.checkout-modern .co-btn-ghost { flex: 1 1 120px; background: var(--h-surface); color: var(--h-text); border-color: var(--h-border); }
.checkout-modern .co-btn-ghost:hover { border-color: var(--h-primary); color: var(--h-primary); }

/* Step 2: review of the entered details */
.co-review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0 0 20px; padding: 16px 18px; border-radius: 14px; background: var(--h-surface-2); border: 1px solid var(--h-border); }
.co-review dt { color: var(--h-muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.co-review dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.checkout-modern:has(#type_private:checked) .co-review__legal { display: none; }

.checkout-modern .co-table { margin: 0; box-shadow: none; border: 1px solid var(--h-border); border-radius: 14px; overflow: hidden; background: var(--h-surface); }
.checkout-modern .co-table th { background: var(--h-surface-2); color: var(--h-muted); }
.checkout-modern .co-table th, .checkout-modern .co-table td { border-bottom: 1px solid var(--h-border); color: var(--h-text); }
.checkout-modern .co-table tfoot td { border-top: 0; border-bottom: 0; font-size: 1.05rem; }
.checkout-modern .co-table tfoot strong { color: var(--h-primary); font-size: 1.2rem; }

/* Order summary card */
.co-summary { position: sticky; top: calc(var(--header-h, 100px) + 16px); }
.co-summary__plan { font-weight: 800; font-size: 1.05rem; margin: -6px 0 10px !important; }
.co-summary__total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--h-border); }
.co-summary__total span { font-weight: 700; color: var(--h-muted); }
.co-summary__total strong { font-family: 'Montserrat', sans-serif; font-size: 1.7rem; color: var(--h-primary); }
.co-summary__perks { display: flex; flex-direction: column; gap: 8px; margin-top: 16px !important; padding-top: 14px !important; border-top: 1px solid var(--h-border); }
.co-summary__perks li { position: relative; padding-left: 24px; color: var(--h-muted); font-size: 0.88rem; }
.co-summary__perks li::before {
    content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--h-primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2325583c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 10px no-repeat;
}

@media (max-width: 860px) {
    .co-grid { grid-template-columns: minmax(0, 1fr); }
    .co-summary { position: static; order: -1; }   /* phones: show what you're buying first */
}
@media (max-width: 560px) {
    .checkout-modern .co-form .form-row,
    .checkout-modern .co-form .form-row:has(.flex-2),
    .co-review { grid-template-columns: minmax(0, 1fr); }
    .checkout-modern .co-actions .home-btn { flex: 1 1 100%; }
}
