/* Service Cards */

.home-section {
    font-family: var(--font-family);
}

.services-conatiner {
    background-color: var(--service-background);
}

.services-heading {
    text-align: center;
    padding: 24px;
    font-size: 44px;
    line-height: 120%;
    font-weight: 600;
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 0 32px 32px;
    /* Default grid stretch — every card in a row matches the tallest card's height, and
       .service-card__actions' margin-top:auto pins each card's button(s) to the bottom,
       so a single-CTA card's button lines up with a double-CTA card's last button. */
    align-items: stretch;
}

.service-card {
    background: var(--color-white);
    border-radius: 8px;
    border: 1px solid var(--border-muted);
    padding: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.service-card__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
}

.service-card__title {
    font-size: 22px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 120%;
}

/* Default (single-CTA) spacing: 24px between the description and the one primary
   button. Cards with a second CTA use .service-card--double-cta below instead — that
   modifier is the ONE thing that must be added/removed if a card's CTA count ever
   becomes config-driven (e.g. an AppConfig flag toggles a secondary CTA on/off).
   Whoever wires that up should conditionally set BOTH of these together in code-behind:
     - single-CTA state: CssClass = "service-card"                    → 24px gap (this rule)
     - double-CTA state: CssClass = "service-card service-card--double-cta" → 16px gap (below)
   Forgetting to swap the class when going single→double (or back) leaves the wrong
   gap for whichever state is actually rendered — see the article-level comment in
   DefaultV2.aspx above artUnregisteredAlarm for the concrete example. */
.service-card__description {
    margin-bottom: 24px;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    text-align: left;
    min-height: 72px;
}

/* Double-CTA spacing override — see the comment on .service-card__description above.
   Desktop: 6px — the secondary block's own 20px top padding/divider (see
   .service-card__secondary) already provides most of the separation needed here; this
   is just a small nudge above the primary button, not a full gap.
   Tablet and mobile (see the media queries below): bumped back up to 16px — cards
   stack full-width there and read too cramped without some space above the button. */
.service-card--double-cta .service-card__description {
    margin-bottom: 6px;
}

/* Pins the action block to the bottom of the card. Combined with .services__grid's
   default stretch, every card in a row shares the tallest card's height, so a single-CTA
   card's button bottom-aligns with a double-CTA card's last button — all 3 cards stay
   in sync regardless of how many actions any one of them has.
   flex-shrink:0 + the explicit margin-top (not just relying on auto-margin collapse)
   keep this pinned even if a future card nests .service-card__actions inside another
   flex wrapper — always the single source of "push to bottom" logic. */
.service-card__actions {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tighter gap between the primary button and the secondary CTA block below it — only
   applies when there's actually a second thing in .service-card__actions (single-CTA
   cards have just the one button, so this gap value never shows up there anyway). */
.service-card--double-cta .service-card__actions {
    gap: 12px;
}

.service-card__button {
    background-color: var(--button-primary);
    border-radius: 4px;
    border: none;
    width: 100%;
    padding: 8px 0;
    color: var(--button-text-primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 150%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 44px;
}

    .service-card__button:hover {
        background-color: var(--color-primary);
        color: var(--color-white);
    }

    .service-card__button:focus-visible {
        outline: 3px solid var(--color-focus);
        outline-offset: 2px;
    }

/* Secondary CTA — an optional second action stacked below the primary one within the
   same .service-card__actions wrapper (e.g. "Already registered? ..." + Sign In). Any
   service card can opt into this pattern later; it's not specific to one card. A thin
   top divider + small padding groups it as an alternate path, distinct from the primary
   action above, without a large gap making it look like two separate sections. */
.service-card__secondary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    padding-top: 8px;
    border-top: 1px solid var(--border-muted);
}

.service-card__secondary-text {
    font-size: 14px;
    line-height: 150%;
    color: var(--color-black);
    margin: 0;
}

    .service-card__secondary-text strong {
        font-weight: 600;
    }

/* Invoice */

.invoice-container {
    background-color: var(--invoice-background);
    padding-bottom: 16px;
}

.invoice__title {
    padding: 32px 0;
    text-align: center;
    font-size: 44px;
    font-weight: 600;
    line-height: 120%;
}

.invoice-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    align-items: start;
    padding: 0 32px;
}

/* Cards */

.invoice-card {
    border: 1px solid var(--invoice-border);
    border-radius: 8px;
    background: var(--color-white);
    margin-bottom: 1rem;
}

.invoice-card__header {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    color: var(--color-black);
    font-size: 22px;
    line-height: 120%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

    .invoice-card__header::-webkit-details-marker {
        display: none;
    }

    .invoice-card__header:focus-visible {
        outline: 3px solid var(--color-focus);
        outline-offset: 2px;
        border-radius: 6px;
    }

    .invoice-card__header::after {
        content: url("../images/svg/collapse-icon.svg");
        width: 12px;
        height: 8px;
        flex-shrink: 0;
    }

.invoice-card[open] .invoice-card__header::after {
    content: url("../images/svg/expended-icon.svg");
    width: 12px;
    height: 8px;
}

.invoice-card__body {
    padding: 0 1.25rem 1rem;
}

    .invoice-card__body p {
        color: var(--color-black);
        font-weight: 400;
        line-height: 150%;
        font-size: 16px;
    }

/* Steps */

.invoice-steps {
    margin: 1.5rem 0 0;
    padding-left: 0;
    list-style: none;
    counter-reset: step;
}

    .invoice-steps li {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        position: relative;
        padding-left: 2rem;
        counter-increment: step;
    }

        .invoice-steps li::before {
            content: counter(step);
            position: absolute;
            left: 0;
            top: 0;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background-color: var(--color-primary-btn);
            color: var(--color-white);
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }

    .invoice-steps strong {
        display: block;
        margin-bottom: 0.35rem;
        color: var(--color-black);
        font-size: 16px;
        line-height: 150%;
    }

    .invoice-steps p {
        color: var(--color-text-muted);
        font-size: 14px;
        line-height: 140%;
    }

.invoice-card__btn-link {
    display: flex;
    margin-top: 1rem;
    line-height: 150%;
    color: var(--color-primary-btn);
    font-weight: 600;
    text-decoration: none;
    justify-content: flex-end;
    padding-bottom: 16px;
}

    .invoice-card__btn-link:hover {
        text-decoration: underline;
    }

/* Sidebar */

.invoice-sidebar {
    background: var(--color-sidebar-bg);
    border: 1px solid var(--color-sidebar-border);
    border-radius: 8px;
    padding: 0 32px;
}

.stat-card {
    text-align: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--color-sidebar-divider);
}

    .stat-card:last-child {
        border-bottom: none;
    }

.stat-number {
    display: block;
    font-size: 56px;
    line-height: 120%;
    font-weight: 800;
    color: var(--color-sidebar-text);
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-sidebar-label);
}

/* Our Community Carousel */
.community-carousel {
    padding: 40px 0 0px;
    background-color: var(--invoice-background);
    overflow: hidden;
}

.community-carousel__title {
    text-align: center;
    font-size: 44px;
    font-weight: 600;
    line-height: 120%;
    color: var(--color-black);
    margin-bottom: 26px;
}

.community-carousel__stage {
    position: relative;
    display: flex;
    align-items: center;
}

.community-carousel__viewport {
    flex: 1;
    overflow: hidden;
}

.community-carousel__track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
    touch-action: pan-y;
}

@media (prefers-reduced-motion: reduce) {
    .community-carousel__track {
        transition: none;
    }
}

.community-carousel__slide {
    flex: 0 0 100%;
    width: 100%;
}

.community-carousel__img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.community-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 46px;
    height: 46px;
    border-radius: 4px;
    border: 1px solid var(--color-form-border);
    background: var(--color-icon-bg);
    color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition), color var(--transition);
}

.community-carousel__btn--prev {
    left: 32px;
}

.community-carousel__btn--next {
    right: 32px;
}

.community-carousel__btn:hover {
    background-color: var(--color-primary-btn);
    color: var(--color-white);
    border-color: var(--color-primary-btn);
}

.community-carousel__btn:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.community-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.community-carousel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border-muted);
    cursor: pointer;
    padding: 0;
    transition: background-color var(--transition), transform var(--transition);
}

.community-carousel__dot--active {
    background: var(--color-primary-btn);
    transform: scale(1.3);
}

.community-carousel__dot:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

/* Documents */

.documents {
    padding: 32px 0 100px;
    background-color: var(--service-background);
}

.documents__title {
    margin-bottom: 32px;
    text-align: center;
    font-size: 44px;
    font-weight: 600;
    color: var(--color-black);
}

.documents__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-width: 60%;
    margin: 0 auto;
}

.documents__icon,
.documents__download {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
    color: var(--color-text-muted);
}

.documents__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background-color: var(--color-white);
    border: 1px solid var(--invoice-border);
    border-radius: 6px;
    color: var(--color-black);
    text-decoration: none;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

    .documents__card:hover {
        border-color: var(--color-border-hover);
        background-color: var(--color-form-bg);
    }

    .documents__card:focus-visible {
        outline: 3px solid var(--color-focus);
        outline-offset: 2px;
    }

.documents__content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.documents__name {
    font-size: 16px;
    font-weight: 600;
    line-height: 120%;
}

/* Services Cry Wolf */

.services-cry-wolf {
    padding: 40px 32px;
    background-color: var(--border-muted);
}

.services-cry-wolf__wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
    padding: 48px;
    background-color: var(--color-dark-card);
    border-radius: 48px;
}

.services-cry-wolf__content {
    max-width: 500px;
}

.services-cry-wolf__title {
    margin: 0 0 1rem;
    color: var(--color-form-bg);
    font-size: 44px;
    font-weight: 600;
    line-height: 120%;
}

.services-cry-wolf__description {
    margin: 0;
    color: var(--color-form-bg);
    font-size: 18px;
    font-weight: 400;
    line-height: 150%;
}

.services-cry-wolf__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 420px;
}

.services-cry-wolf__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-link-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-form-bg);
    transition: all var(--transition);
}

    .services-cry-wolf__link:hover {
        background-color: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.4);
    }

    .services-cry-wolf__link:focus-visible {
        outline: 3px solid var(--color-white);
        outline-offset: 3px;
    }

.services-cry-wolf__link-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.services-cry-wolf__icon {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
}

.services-cry-wolf__link-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 150%;
    color: var(--color-form-bg);
}

.services-cry-wolf__external {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .services-heading {
        padding: 32px 0;
        font-size: 36px;
    }

    .services__grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0 24px 40px;
    }

    .service-card--double-cta .service-card__description {
        margin-bottom: 16px;
    }

    .invoice-container {
        padding-bottom: 40px;
    }

    .invoice__title {
        font-size: 36px;
    }

    .invoice-layout {
        padding: 0 24px;
        grid-template-columns: 1fr;
        gap: 0;
    }

    .invoice-card {
        margin-bottom: 24px;
    }

    .community-carousel__title {
        font-size: 36px;
    }

    .community-carousel__img {
        height: 320px;
    }

    .community-carousel__btn--prev {
        left: 24px;
    }

    .community-carousel__btn--next {
        right: 24px;
    }

    .documents {
        padding-bottom: 80px;
    }

    .documents__title {
        font-size: 36px;
    }

    .documents__grid {
        grid-template-columns: 1fr;
        padding: 0 24px;
        gap: 24px;
        max-width: 100%;
    }

    .services-cry-wolf {
        padding: 48px 24px;
    }

    .services-cry-wolf__title {
        font-size: 32px;
    }

    .service-card__description {
        min-height: unset;
    }

    .services-cry-wolf__wrapper {
        flex-direction: column;
        gap: 24px;
    }

    .services-cry-wolf__content,
    .services-cry-wolf__links {
        max-width: 100%;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .services-heading {
        padding: 24px 16px;
        font-size: 28px;
    }

    .services__grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px 40px;
    }

    .service-card__description {
        min-height: unset;
    }

    .service-card--double-cta .service-card__description {
        margin-bottom: 16px;
    }

    .invoice-container {
        padding-bottom: 40px;
    }

    .invoice__title {
        font-size: 28px;
        padding: 24px 16px;
    }

    .invoice-layout {
        padding: 0 16px;
        grid-template-columns: 1fr;
        gap: 0;
    }

    .invoice-card {
        margin-bottom: 16px;
    }

    .invoice-card__header {
        font-size: 18px;
    }

    .community-carousel__title {
        font-size: 28px;
    }

    .community-carousel__img {
        height: 220px;
    }

    .community-carousel__btn {
        width: 36px;
        height: 36px;
    }

    .community-carousel__btn--prev {
        left: 16px;
    }

    .community-carousel__btn--next {
        right: 16px;
    }

    .documents {
        padding-bottom: 60px;
    }

    .documents__title {
        font-size: 28px;
    }

    .documents__grid {
        grid-template-columns: 1fr;
        padding: 0 16px;
        gap: 12px;
        max-width: 100%;
    }

    .services-cry-wolf {
        padding: 48px 16px;
    }

    .services-cry-wolf__title {
        font-size: 28px;
    }

    .services-cry-wolf__description {
        font-size: 16px;
    }

    .services-cry-wolf__wrapper {
        flex-direction: column;
        gap: 24px;
        padding: 24px 20px;
        border-radius: 24px;
    }

    .services-cry-wolf__content,
    .services-cry-wolf__links {
        max-width: 100%;
    }

    .services-cry-wolf__link {
        padding: 16px;
    }

    .services-cry-wolf__link-text {
        font-size: 16px;
    }

    .hero__description,
    .documents__name,
    .services-cry-wolf__link-text {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}
