/* ==========================================================================
   layout/home.css — public one-page website.
   Flat design system (variables.css), Inter, Phosphor. Fully responsive:
   everything is built to look tip-top on phones first.
   ========================================================================== */

.home-container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* ----- Buttons used on the landing (extends components/buttons.css;
   .btn-lg and .btn-block already live there) ------------------------------- */
.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border-strong, var(--color-border));
}

.btn-ghost:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ----- Navbar ------------------------------------------------------------ */
.home-nav {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--color-surface);
}

.home-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    height: 68px;
}

.home-logo {
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.home-logo img {
    max-height: 34px;
    width: auto;
    display: block;
}

.home-nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.home-nav-links > a {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.home-nav-links > a:hover {
    color: var(--color-primary);
}

/* Vertical divider that brackets the Developers | Support group. */
.home-nav-sep {
    width: 1px;
    height: 18px;
    background: var(--color-border-strong, var(--color-border));
}

.home-nav-auth {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    margin-left: var(--space-2);
}

/* Split auth button — two equal halves (Log in | Register) in one pill. */
.home-auth-split {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;                /* both sides exactly equal width */
    border: 1px solid var(--color-border-strong, var(--color-border));
    border-radius: var(--radius);
    overflow: hidden;
}

.home-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    background: var(--color-surface);
    white-space: nowrap;
}

.home-auth-btn + .home-auth-btn {
    border-left: 1px solid var(--color-border-strong, var(--color-border));
}

.home-auth-btn:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

.home-auth-btn-primary {
    background: var(--color-primary);
    color: var(--color-text-invert, #fff);
    border-left-color: var(--color-primary);
}

.home-auth-btn-primary:hover {
    background: var(--color-primary-hover, var(--color-primary));
    color: var(--color-text-invert, #fff);
}

/* Logged-in single button (My account) — same pill as the split, one piece. */
.home-auth-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 var(--space-5);
    border-radius: var(--radius);
    background: var(--color-primary);
    color: var(--color-text-invert, #fff);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
}

.home-auth-account:hover {
    background: var(--color-primary-hover, var(--color-primary));
    color: var(--color-text-invert, #fff);
}

.home-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
}

.home-burger span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition-fast);
}

.home-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.home-burger.is-open span:nth-child(2) { opacity: 0; }
.home-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----- Hero -------------------------------------------------------------- */
.home-hero {
    text-align: center;
    padding: clamp(88px, 10vw, 128px) 0 clamp(72px, 8vw, 104px);
    background: var(--color-surface-alt);
}

.home-eyebrow {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-3);
}

.home-hero-title {
    font-size: clamp(2.9rem, 7.6vw, 5rem);
    line-height: 1.07;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    color: var(--color-text);
    max-width: 20ch;                       /* forces the headline onto ~2 lines */
    margin: 0 auto var(--space-4);
}

.home-hero-sub {
    font-size: clamp(1.05rem, 2.6vw, 1.3rem);
    color: var(--color-text-muted);
    max-width: 54ch;
    margin: 0 auto var(--space-7);
    line-height: 1.6;
}

/* Two equal-width columns → both CTAs are exactly the same width AND height. */
.home-hero-cta {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--space-3);
}

.home-hero-cta .btn {
    width: 100%;
    height: 52px;
    min-height: 52px;
    font-weight: var(--font-weight-semibold);
}

/* ----- Full-width scrolling ticker (benefits) ---------------------------- */
.home-ticker {
    width: 100%;
    overflow: hidden;
    background: var(--color-primary);
    padding: var(--space-3) 0;
}

.home-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation: home-ticker-scroll 34s linear infinite;
}

.home-ticker-item {
    padding: 0 var(--space-5);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
}

.home-ticker-sep {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

/* The track holds two identical copies, so -50% loops seamlessly. */
@keyframes home-ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .home-ticker-track {
        animation: none;
    }
}

/* ----- Sections ---------------------------------------------------------- */
.home-section {
    padding: var(--space-7) 0;
}

.home-section-alt {
    background: var(--color-surface-alt);
}

.home-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-6);
}

.home-h2 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    color: var(--color-text);
    line-height: 1.2;
}

.home-lead {
    margin-top: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
    line-height: 1.6;
}

/* ----- Feature grid ------------------------------------------------------ */
.home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;                    /* every card the same height */
    gap: var(--space-4);
}

.home-feature {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: var(--space-5);
    transition: border-color var(--transition-fast);
}

.home-feature:hover {
    border-color: var(--color-primary);
}

/* Keep the card content above the faded corner icon. */
.home-feature h3,
.home-feature p,
.home-more {
    position: relative;
    z-index: 1;
}

/* Big faded glyph in the corner — mostly outside, only a portion shows. */
.home-feature-bg {
    position: absolute;
    right: -46px;
    bottom: -54px;
    font-size: 168px;
    line-height: 1;
    opacity: 0.1;
    color: var(--color-primary);
    transform: rotate(-12deg);
    pointer-events: none;
    z-index: 0;
}

.home-feature h3 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.home-feature p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-4);
}

.home-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
}

.home-more i {
    transition: transform var(--transition-fast);
}

.home-more:hover i {
    transform: translateX(3px);
}

/* ----- Pricing ----------------------------------------------------------- */
.home-price-card {
    position: relative;
    overflow: hidden;
    max-width: 560px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: var(--space-6);
    text-align: center;
}

.home-price-free,
.home-price-note,
.home-price-list {
    position: relative;
    z-index: 1;
}

/* Big faded banknote in the corner — mostly outside, only a portion shows. */
.home-price-bg {
    position: absolute;
    right: -58px;
    bottom: -66px;
    font-size: 220px;
    line-height: 1;
    opacity: 0.06;
    color: var(--color-primary);
    transform: rotate(-12deg);
    pointer-events: none;
    z-index: 0;
}

.home-price-free {
    font-size: clamp(2.4rem, 7vw, 3.2rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    color: var(--color-primary);
    line-height: 1;
}

.home-price-note {
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* Note under the price list: the same commission for EVERY card, no
   matter the issuing country. */
.home-price-all-cards {
    position: relative;
    z-index: 1;
    margin: var(--space-4) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.home-price-list {
    list-style: none;
    margin: var(--space-5) 0;
    text-align: left;
}

.home-price-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}

.home-price-list li:last-child {
    border-bottom: 0;
}

.home-price-list span {
    color: var(--color-text-muted);
}

.home-price-list strong {
    color: var(--color-text);
    white-space: nowrap;
}

/* ----- Accepted card schemes (footer, discreet) ------------------------- */
.home-foot-cards {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.home-foot-cards-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-right: var(--space-1);
}

.home-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.home-card-sm {
    width: 42px;
    height: 27px;
}

.home-card-sm svg {
    width: 28px;
    height: auto;
}

/* ----- Contact CTA band -------------------------------------------------- */
.home-cta-band {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    flex-wrap: wrap;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: var(--space-6);
}

.home-cta-band > div,
.home-cta-band > .btn {
    position: relative;
    z-index: 1;
}

.home-cta-band .home-h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
}

/* Big faded envelope in the corner — mostly outside, only a portion shows. */
.home-cta-bg {
    position: absolute;
    right: -56px;
    bottom: -64px;
    font-size: 210px;
    line-height: 1;
    opacity: 0.06;
    color: var(--color-primary);
    transform: rotate(-12deg);
    pointer-events: none;
    z-index: 0;
}

/* ----- Footer ------------------------------------------------------------ */
.home-footer {
    background: var(--color-surface-alt);
}

.home-footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
    gap: var(--space-6);
    padding: var(--space-7) var(--space-5);
}

.home-footer-brand p {
    margin-top: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.7;
    max-width: 30ch;
}

.home-footer-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.home-footer-col h4 {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.home-footer-col a,
.home-footer-company span,
.home-footer-company a {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.home-footer-col a:hover,
.home-footer-company a:hover {
    color: var(--color-primary);
}

.home-footer-company strong {
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

.home-foot-copy {
    margin-top: var(--space-4);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* The end-of-footer copyright is mobile-only. */
.home-foot-copy-mob {
    display: none;
}

/* ----- Modals ------------------------------------------------------------ */
.home-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.home-modal[hidden] {
    display: none;
}

.home-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 28, 0.55);
}

.home-modal-box {
    position: relative;
    z-index: 1;
    overflow: hidden;                      /* clip the faded corner glyph */
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: var(--space-6);
}

/* Content scrolls inside; the box stays clipped so the corner icon is cut. */
.home-modal-content {
    position: relative;
    z-index: 1;
    max-height: calc(88vh - 2 * var(--space-6));
    overflow-y: auto;
}

.home-modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--color-text-muted);
}

.home-modal-close:hover {
    color: var(--color-text);
}

/* Big faded glyph in the corner — mostly outside, only a portion shows. */
.home-modal-bg {
    position: absolute;
    right: -64px;
    bottom: -76px;
    font-size: 230px;
    line-height: 1;
    opacity: 0.06;
    color: var(--color-primary);
    transform: rotate(-12deg);
    pointer-events: none;
    z-index: 0;
}

.home-modal-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.home-modal-lead {
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.home-modal-detail {
    color: var(--color-text);
    font-size: var(--font-size-sm);
    line-height: 1.75;
    text-align: justify;
    margin-bottom: var(--space-5);
}

/* ----- Contact form ------------------------------------------------------ */
.home-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.home-form .field {
    margin-bottom: var(--space-3);
}

.home-form textarea.input {
    resize: vertical;
    min-height: 120px;
}

.home-form-note {
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    font-size: var(--font-size-sm);
}

.home-form-note.is-ok {
    background: rgba(23, 162, 74, 0.1);
    color: var(--color-success, #17a24a);
}

.home-form-note.is-error {
    background: rgba(223, 27, 65, 0.1);
    color: var(--color-danger, #df1b41);
}

/* Small legal notice shown when the reCAPTCHA badge is hidden. */
.home-form-recaptcha {
    margin: var(--space-3) 0 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: center;
}

.home-form-recaptcha a {
    color: var(--color-text-muted);
    text-decoration: underline;
}

/* Truly invisible: hide the floating reCAPTCHA badge (the notice above
   keeps us compliant with Google's terms). */
.grecaptcha-badge {
    visibility: hidden;
}

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

    .home-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-5);
    }

    /* Mobile nav: links collapse into a dropdown panel under the bar. */
    .home-burger {
        display: flex;
    }

    .home-nav-links {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        padding: var(--space-4) var(--space-5);
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-fast), transform var(--transition-fast);
    }

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

    /* The vertical dividers make no sense in the stacked mobile menu. */
    .home-nav-sep {
        display: none;
    }

    .home-nav-auth {
        display: block;
        width: 100%;
        margin-left: 0;
        margin-top: var(--space-2);
        padding-top: var(--space-3);
        border-top: 1px solid var(--color-border);
    }

    /* Split auth button spans the full width of the mobile menu. */
    .home-auth-split {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .home-auth-btn {
        min-height: 44px;
    }

    /* Logged-in single button: full width, contained (no overflow). */
    .home-auth-account {
        display: flex;
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;
    }
}

@media (max-width: 560px) {
    .home-container {
        padding: 0 var(--space-4);
    }

    /* Compact sections + hero on phones. */
    .home-section {
        padding: var(--space-6) 0;
    }

    .home-hero {
        padding: 72px 0 56px;
    }

    .home-hero-title {
        font-size: clamp(1.9rem, 9vw, 2.6rem);
    }

    /* Hero CTAs: two equal 50/50 buttons, label never overflows. */
    .home-hero-cta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .home-hero-cta .btn {
        height: auto;
        min-height: 48px;
        padding: var(--space-2) var(--space-2);
        font-size: var(--font-size-sm);
        white-space: normal;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    /* Feature kučice: TWO compact rectangles per row, small type, with the
       description text kept inside (clamped so every card stays tidy). */
    .home-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2);
    }

    .home-feature {
        padding: var(--space-3);
        border-radius: 10px;
    }

    .home-feature h3 {
        font-size: 12px;
        line-height: 1.25;
        margin-bottom: 3px;
    }

    .home-feature p {
        font-size: 10px;
        line-height: 1.45;
        margin-bottom: var(--space-2);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .home-more {
        margin-top: auto;
        font-size: 10px;
        gap: 3px;
    }

    .home-more i {
        font-size: 11px;
    }

    .home-feature-bg {
        font-size: 100px;
        right: -24px;
        bottom: -32px;
        opacity: 0.13;
    }

    /* Footer: compact two-column grid, small type, centered copyright. */
    .home-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
        padding: var(--space-5) var(--space-4);
        font-size: var(--font-size-xs);
    }

    .home-footer-brand,
    .home-footer-company {
        grid-column: 1 / -1;
    }

    .home-footer-col h4 {
        margin-bottom: var(--space-1);
    }

    .home-footer-col {
        gap: var(--space-1);
    }

    .home-footer-col a,
    .home-footer-company span,
    .home-footer-company a {
        font-size: var(--font-size-xs);
    }

    .home-foot-tagline,
    .home-foot-copy-desk {
        display: none;
    }

    .home-foot-copy-mob {
        display: block;
        grid-column: 1 / -1;
        margin-top: var(--space-2);
        text-align: center;
        white-space: nowrap;
        font-size: var(--font-size-xs);
        color: var(--color-text-muted);
    }

    .home-form-row {
        grid-template-columns: 1fr;
    }

    /* Compact CTA band: smaller heading + lead, full-width button. */
    .home-cta-band {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
        padding: var(--space-5);
    }

    .home-cta-band .home-h2 {
        font-size: 1.2rem;
    }

    .home-cta-band .home-lead {
        margin-top: var(--space-1);
        font-size: var(--font-size-xs);
    }

    .home-cta-band .btn {
        width: 100%;
        text-align: center;
    }
}

/* Very narrow phones: keep two compact cards per row (never a single column). */
/* Very narrow phones: the 560px compact rules inherit; only tighten type. */
@media (max-width: 380px) {
    .home-grid {
        gap: 6px;
    }

    .home-feature {
        padding: var(--space-2);
    }

    .home-feature h3 {
        font-size: 11px;
    }

    .home-feature p {
        font-size: 9px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .home-feature-bg {
        font-size: 80px;
        right: -18px;
        bottom: -24px;
    }

    .home-hero-cta .btn {
        font-size: var(--font-size-xs);
    }

    .home-modal-box {
        padding: var(--space-5) var(--space-4);
    }
}
