﻿/* ============================================================
   Pricing plans - PricingPlansComponent.razor
   Fluent design tokens only (no product-specific variables), so the
   same component renders correctly under Light/Dark in every host.
   Logical properties throughout for RTL/LTR.
   ============================================================ */

/* The root is the size container the Responsive rules at the end of this file measure.
   width: 100% keeps it filling its host: a size container does not size itself from its
   content. */
.sc-ui-pricing {
    text-align: start;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: sc-ui-pricing;
}

.sc-ui-pricing-group {
    padding-block: 16px;
    padding-inline: 16px;
}

.sc-ui-pricing-group-heading {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
    margin: 0 0 6px;
}

.sc-ui-pricing-group-lead {
    color: var(--neutral-foreground-hint);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 20px;
}

/* Small uppercase label above the Free tier name. */
.sc-ui-pricing-eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-foreground-rest);
    margin-bottom: 8px;
}

/* Free panel: summary pane (start, sized to its content so the
   Marketplace image fits beside the name/price) + details pane (end). */
.sc-ui-pricing-card-free {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.sc-ui-pricing-free-summary {
    padding: 28px 24px;
    background: color-mix(in srgb, var(--accent-fill-rest) 10%, var(--neutral-layer-1));
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Name/price group and Marketplace image on one row; wraps to two rows when narrow. */
.sc-ui-pricing-free-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
}

.sc-ui-pricing-free-details {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
}

/* Paid plans: one collapsible section, full width like the Free panel. */
.sc-ui-pricing-paid-section {
    margin-top: 24px;
}

/* Paid and dedicated plan grids. minmax(0, 1fr): a column never grows past its share of
   the grid to fit its content, so a card cannot extend beyond the grid's edge. */
.sc-ui-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sc-ui-pricing-grid-dedicated {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sc-ui-pricing-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: default;
}

    .sc-ui-pricing-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--elevation-shadow-card-hover, 0 8px 24px rgba(0, 0, 0, 0.12));
    }

/* Highlighted card: the plan a marketplace purchase resolved to. */
.sc-ui-pricing-card-highlight {
    border: 2px solid var(--accent-fill-rest);
}

/* Plan header: tier name and price together at the start of one row, identical on every plan.
   The price moves under the tier name when the card is too narrow for both on one row. */
.sc-ui-pricing-plan-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0 12px;
    margin-bottom: 12px;
}

.sc-ui-pricing-card-free .sc-ui-pricing-plan-head {
    margin-bottom: 0;
}

/* Tier name and price share one display font so every host renders them alike. */
.sc-ui-pricing-tier,
.sc-ui-pricing-price {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    color: var(--neutral-foreground-rest);
}

.sc-ui-pricing-tier {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
}

.sc-ui-pricing-price {
    font-size: 1.6rem;
    font-weight: 700;
    white-space: nowrap;
}

.sc-ui-pricing-card-free .sc-ui-pricing-tier {
    font-size: 1.4rem;
}

.sc-ui-pricing-card-free .sc-ui-pricing-price {
    font-size: 2.2rem;
}

.sc-ui-pricing-price span {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--neutral-foreground-hint);
    margin-inline-start: 4px;
}

/* Short sentence under the Free price. */
.sc-ui-pricing-blurb {
    font-size: 0.9rem;
    color: var(--neutral-foreground-hint);
    line-height: 1.5;
    margin-block: 6px 0;
}

/* Plan description: trusted resx HTML (paragraphs, lists, a Support link). */
.sc-ui-pricing-description {
    text-align: start;
    color: var(--neutral-foreground-hint);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.75rem;
    flex: 1;
}

    .sc-ui-pricing-description ul {
        padding-inline-start: 20px;
        margin: 8px 0;
    }

    .sc-ui-pricing-description a {
        color: var(--accent-foreground-rest);
    }

/* Free feature list (resx HTML): two columns when the pane is wide enough. */
.sc-ui-pricing-includes {
    margin-top: 0;
}

    .sc-ui-pricing-includes p {
        margin: 0 0 10px;
        color: var(--neutral-foreground-rest);
    }

    .sc-ui-pricing-includes ul {
        columns: 2;
        column-gap: 24px;
    }

    .sc-ui-pricing-includes li {
        break-inside: avoid;
        padding-block: 3px;
    }

/* Usage meter: always on Free; on a paid plan in place of its action when held. */
.sc-ui-pricing-meter {
    width: 100%;
    margin-top: auto;
}

.sc-ui-pricing-free-summary .sc-ui-pricing-meter {
    margin-top: 12px;
}

/* Subscription rows: every instance the user holds on the plan (any status), stacked. */
.sc-ui-pricing-subscriptions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-block: 8px 12px;
}

.sc-ui-pricing-subscription {
    border-radius: var(--control-corner-radius, 4px);
    padding: 8px;
}

/* Highlighted row: the marketplace purchase awaiting activation (full background). */
.sc-ui-pricing-subscription-highlight {
    background: var(--accent-fill-rest);
    color: var(--foreground-on-accent-rest);
}

    .sc-ui-pricing-subscription-highlight .sc-ui-compound-label-text,
    .sc-ui-pricing-subscription-highlight .sc-ui-compound-label-description {
        color: var(--foreground-on-accent-rest);
    }

/* One subscription instance: compound label, optional meter, suspended notice, actions. */
.sc-ui-subscription {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.sc-ui-subscription-meter {
    width: 100%;
}

.sc-ui-subscription-suspended-message {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--neutral-foreground-hint);
}

.sc-ui-subscription-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}


/* Action area: host-supplied cells or the built-in link, stacked full width. */
.sc-ui-pricing-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: auto;
}

.sc-ui-pricing-footnote {
    padding: 16px 8px 0;
    font-size: 0.85rem;
    color: var(--neutral-foreground-hint);
    text-align: center;
}

/* Marketplace link: the image at its rendered size, shrinking only when the pane is narrower. */
.sc-ui-pricing-marketplace-link {
    display: inline-block;
    line-height: 0;
}

.sc-ui-pricing-marketplace-image {
    max-width: 100%;
    height: auto;
}

/* The closing footnote sits outside the plan groups, so it carries its own inline inset. */
.sc-ui-pricing > .sc-ui-pricing-footnote {
    padding-inline: 24px;
}

/* ===== Responsive =====
   Sized by the width of the pricing block itself (container queries), not the window, so
   the same rules serve a full page, a sidebar column and an add-in task pane. */
@container sc-ui-pricing (max-width: 1024px) {
    .sc-ui-pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container sc-ui-pricing (max-width: 768px) {
    .sc-ui-pricing-card-free {
        grid-template-columns: minmax(0, 1fr);
    }

    .sc-ui-pricing-includes ul {
        columns: 1;
    }

    .sc-ui-pricing-grid,
    .sc-ui-pricing-grid-dedicated {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Narrow column (sidebar, add-in task pane): tight insets and smaller display type. */
@container sc-ui-pricing (max-width: 480px) {
    .sc-ui-pricing-group {
        padding-inline: 4px;
        padding-block: 8px;
    }

    .sc-ui-pricing > .sc-ui-pricing-footnote {
        padding-inline: 8px;
    }

    .sc-ui-pricing-group-heading {
        font-size: 1.2rem;
    }

    .sc-ui-pricing-group-lead {
        margin-bottom: 12px;
    }

    .sc-ui-pricing-free-summary,
    .sc-ui-pricing-free-details {
        padding: 12px;
    }

    .sc-ui-pricing-card {
        padding: 12px;
    }

        .sc-ui-pricing-card:hover {
            transform: none;
        }

    /* The Free card keeps its panes flush to its edges; the panes carry the inset. */
    .sc-ui-pricing-card-free {
        padding: 0;
    }

        .sc-ui-pricing-card-free .sc-ui-pricing-tier {
            font-size: 1.2rem;
        }

        .sc-ui-pricing-card-free .sc-ui-pricing-price {
            font-size: 1.6rem;
        }

    .sc-ui-pricing-paid-section {
        margin-top: 12px;
    }

    .sc-ui-pricing-grid {
        gap: 8px;
    }
}

/* The fields stack with even spacing. A flex column is the same in both text directions. */
.sc-ui-email {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* The message as it will be sent, scrolling inside its own area. */
.sc-ui-email-body {
    max-height: 40vh;
    overflow-y: auto;
    border: calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest, rgba(0, 0, 0, 0.15));
    border-radius: var(--control-corner-radius, 4px);
}

