/* Plan card (WebbuilderUI Components/PlanCard.razor), shared by every Webbuilder site as
   _content/WebbuilderUI/css/plan-card.css. A page lays the cards out in its own grid. */

.plancard {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 48px 24px 27px;
    border: 1px solid var(--app-line);
    border-radius: 24px;
    background: var(--app-surface);
    /* Own layer, so the text is not redrawn (a visible flash) each time the hover lift starts and ends */
    will-change: transform;
    transition: transform 0.5s var(--app-ease-out), box-shadow 0.4s ease;
}

/* Animatable angle for the rotating gradient border */
@property --plancard-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

/* Featured plan: rotating gradient outline, tinted background and gradient badge */
.plancard-featured {
    padding: 47px 23px 26px;
    border: 2px solid transparent;
    background:
        linear-gradient(var(--app-surface-soft), var(--app-surface-soft)) padding-box,
        conic-gradient(from var(--plancard-angle), #763DE8, #B57CDF, #FFB7A5, #B57CDF, #763DE8) border-box;
    box-shadow: 0 24px 48px rgba(118, 61, 232, 0.16);
    overflow: hidden;
    animation: plancard-border-spin 6s linear infinite;
}

@media (hover: hover) {
    .plancard:hover {
        transform: translateY(-6px);
        box-shadow: var(--app-shadow-card);
    }

    .plancard-featured:hover {
        box-shadow: 0 28px 56px rgba(118, 61, 232, 0.24);
    }
}

@keyframes plancard-border-spin {
    to {
        --plancard-angle: 360deg;
    }
}

.plancard-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    margin: 0;
    background: linear-gradient(90deg, #763DE8 0%, #A776E6 55%, #FFB7A5 100%);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--app-color-white);
    overflow: hidden;
}

/* Light sweeps across the badge every few seconds */
.plancard-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
    transform: translateX(-100%);
    animation: plancard-badge-sweep 3.6s ease-in-out infinite 1s;
}

@keyframes plancard-badge-sweep {
    0% {
        transform: translateX(-100%);
    }

    40%,
    100% {
        transform: translateX(100%);
    }
}

.plancard-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--app-text);
}

.plancard-current-mark {
    font-size: 11px;
}

.plancard-tagline {
    margin: 8px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--app-text-muted);
}

.plancard-amount {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 26px 0 0;
}

.plancard-value {
    font-size: 44px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--app-text);
}

/* Digits keep the same width, also while counting up */
.plancard-value-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.plancard-period {
    font-size: 14px;
    color: var(--app-text-muted);
}

.plancard-note {
    min-height: 15px;
    margin: 12px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: var(--app-text-muted);
}

.plancard-action {
    margin-top: 24px;
}

/* The site's button or link inside the card */
.plancard-btn {
    width: 100%;
}

/* ---------- feature list ---------- */

.plancard-features {
    margin: 27px 0 0;
    padding: 0;
    list-style: none;
}

.plancard-feature {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14.5px;
    line-height: 21px;
    color: var(--app-text);
}

.plancard-feature + .plancard-feature {
    margin-top: 16px;
}

/* Check marks pop in one after another when the card appears; inside a scroll-reveal block (app-reveal) they wait
   until the block is revealed */
.plancard-feature-check {
    flex-shrink: 0;
    font-size: 17px;
    line-height: 21px;
    color: var(--app-accent);
    animation: plancard-check-pop 0.55s var(--app-ease-spring) backwards;
    animation-delay: calc(0.45s + var(--plancard-i, 0) * 0.07s);
}

.app-js .app-reveal:not(.app-revealed) .plancard-feature-check {
    scale: 0;
    animation: none;
}

@keyframes plancard-check-pop {
    from {
        scale: 0;
        rotate: -45deg;
    }

    to {
        scale: 1;
        rotate: 0deg;
    }
}

/* ⓘ icon; its text is shown by the fluid tooltip */
.plancard-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 21px;
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    color: var(--app-accent);
    cursor: pointer;
}

.plancard-info:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 2px;
    border-radius: 50%;
}

/* ---------- skeleton (PlanCardSkeleton.razor): shapes in the card's own elements ---------- */

.plancard-skeleton {
    pointer-events: none;
}

/* The featured card's 2px outline and its badge band, as on .plancard-featured and .plancard-badge */
.plancard-skeleton-featured {
    padding: 47px 23px 26px;
    border-width: 2px;
    overflow: hidden;
}

.plancard-skeleton .plancard-skeleton-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    border-radius: 0;
}

/* Text the card will show, unseen: the shape is drawn behind each line of it, so it wraps like the text itself */
.plancard-skeleton .plancard-skeleton-text {
    display: inline;
    height: auto;
    max-width: none;
    border-radius: 6px;
    color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* A shape standing for a line of text, centred in the line like the text */
.plancard-skeleton-line > .app-skel {
    display: inline-block;
    vertical-align: middle;
}

/* The current plan mark: its own size, with the shape filling it in place of its colours and text */
.plancard-skeleton .plancard-skeleton-mark {
    position: relative;
    border-color: transparent;
    background: transparent;
    color: transparent;
}

.plancard-skeleton-mark .plancard-skeleton-fill {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
}

/* The check mark of a feature, centred on the feature's first line */
.plancard-skeleton .plancard-skeleton-check {
    margin-top: 2px;
}

.plancard-skeleton .plancard-skeleton-feature-line {
    flex: 0 1 auto;
    height: 12px;
    margin-top: 5px;
}

@media (prefers-reduced-motion: reduce) {
    .plancard-featured,
    .plancard-badge::after,
    .plancard-feature-check {
        animation: none;
    }

    .plancard {
        transition: none;
    }
}
