/* R15.1.c — стили учительских страниц /teacher/billing/* и карточки лимита
   на /teacher/students. Используют CSS-переменные из brand.css (--accent, --text,
   --muted, --shadow-sm, --border). Без MudBlazor — чтобы не привязываться к темам. */

.billing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.billing-card {
    background: #fff;
    border: 1px solid var(--border, #e9eaf0);
    border-radius: 24px;
    padding: 1.6rem;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(20, 22, 35, .04));
}

.billing-card__title {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text, #14161f);
    margin: 0 0 1rem 0;
    letter-spacing: -0.01em;
}

.billing-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--border, #e9eaf0);
}
.billing-card__row:last-of-type { border-bottom: 0; }

.billing-card__label { color: var(--muted, #6b6f80); font-size: 0.92rem; }
.billing-card__value { font-weight: 600; color: var(--text, #14161f); }

.billing-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.7rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.billing-status-pill--active     { background: #e6f7ec; color: #1f8a4d; }
.billing-status-pill--expired    { background: #fce5e5; color: #c8332f; }
.billing-status-pill--cancelled  { background: #f0f0f4; color: #64677a; }
.billing-status-pill--trial      { background: #fff4e0; color: #b86b00; }

/* Прогресс-бар триала */
.billing-progress {
    margin-top: 0.8rem;
    height: 8px;
    border-radius: 100px;
    background: #f0f1f5;
    overflow: hidden;
}
.billing-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #ff8a3d), #ffb27a);
    transition: width 0.3s ease;
}

/* «Что заблокировано» */
.billing-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.billing-feature-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    background: #fafbfc;
}
.billing-feature-row--locked { opacity: 0.7; }
.billing-feature-row__icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}
.billing-feature-row__icon--ok     { background: #e6f7ec; color: #1f8a4d; }
.billing-feature-row__icon--locked { background: #f0f0f4; color: #6b6f80; }
.billing-feature-row__label { font-size: 0.92rem; color: var(--text, #14161f); }

/* Кнопки */
.billing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.billing-btn--primary {
    background: linear-gradient(90deg, var(--accent, #ff8a3d), #ffb27a);
    color: #fff;
    width: 100%;
    box-shadow: 0 4px 14px rgba(255, 138, 61, .25);
}
.billing-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 138, 61, .32);
}
.billing-btn--ghost {
    background: transparent;
    color: var(--text, #14161f);
    border: 1px solid var(--border, #e9eaf0);
}
.billing-btn--current {
    background: #f0f1f5;
    color: var(--muted, #6b6f80);
    cursor: not-allowed;
    width: 100%;
}
.billing-btn--coming-soon {
    background: linear-gradient(135deg, #f0f1f5, #e8e9f0);
    color: var(--muted, #6b6f80);
    cursor: not-allowed;
    width: 100%;
    font-style: italic;
    letter-spacing: 0.02em;
}

/* Trial-баннер на /teacher/billing/upgrade */
.billing-trial-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.4rem;
    background: linear-gradient(90deg, rgba(255, 138, 61, .08), rgba(255, 178, 122, .06));
    border: 1px solid rgba(255, 138, 61, .25);
    border-radius: 18px;
    margin-bottom: 1.6rem;
}
.billing-trial-banner__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 138, 61, .15);
    color: var(--accent, #ff8a3d);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.billing-trial-banner__text { font-size: 0.95rem; color: var(--text, #14161f); }
.billing-trial-banner__text strong { color: var(--accent, #ff8a3d); }

/* ===== Карточки тарифов на /teacher/billing/upgrade ===== */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.4rem;
}
.plan-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border, #e9eaf0);
    border-radius: 24px;
    padding: 1.8rem 1.5rem;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(20, 22, 35, .04));
    transition: border-color 0.2s, box-shadow 0.2s;
}
.plan-card:hover {
    border-color: rgba(255, 138, 61, .35);
    box-shadow: 0 6px 22px rgba(20, 22, 35, .06);
}
.plan-card--featured {
    border-color: rgba(255, 138, 61, .5);
    box-shadow: 0 6px 22px rgba(255, 138, 61, .12);
}

.plan-card__pill {
    align-self: center;
    padding: 0.5rem 1.2rem;
    border-radius: 100px;
    background: #f0f1f5;
    color: var(--text, #14161f);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.005em;
    margin-bottom: 1rem;
}
.plan-card--featured .plan-card__pill {
    background: linear-gradient(90deg, rgba(255, 138, 61, .12), rgba(255, 178, 122, .12));
    color: var(--accent, #ff8a3d);
}

.plan-card__size-label {
    text-align: center;
    color: var(--muted, #6b6f80);
    font-size: 0.85rem;
    margin: 0 0 0.5rem 0;
}

.plan-size-toggle {
    display: inline-flex;
    align-self: center;
    background: #f0f1f5;
    border-radius: 100px;
    padding: 4px;
    margin-bottom: 1.4rem;
    gap: 2px;
}
.plan-size-toggle__btn {
    padding: 0.45rem 1rem;
    border: 0;
    background: transparent;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted, #6b6f80);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.plan-size-toggle__btn--active {
    background: #fff;
    color: var(--text, #14161f);
    box-shadow: 0 2px 6px rgba(20, 22, 35, .08);
    font-weight: 600;
}

.plan-card__limits {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 0.4rem 0 1.5rem 0;
}
.plan-card__limit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.plan-card__limit-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted, #6b6f80);
    font-size: 0.92rem;
}
.plan-card__limit-value {
    font-weight: 700;
    color: var(--text, #14161f);
    font-size: 1.05rem;
}

.plan-card__price {
    text-align: center;
    margin: 0.4rem 0 1.4rem 0;
}
.plan-card__price-value {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--text, #14161f);
    letter-spacing: -0.02em;
}
.plan-card__price-period {
    color: var(--muted, #6b6f80);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* R15.1.c (правка 2026-05-07): блок «Что входит» в карточке тарифа.
   Расшифровка PlanFeature-флагов плана. */
.plan-card__features {
    margin: 0 0 1.2rem 0;
    padding-top: 1rem;
    border-top: 1px dashed var(--border, #e9eaf0);
}
.plan-card__features-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted, #6b6f80);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}
.plan-card__features-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.plan-card__features-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.88rem;
    color: var(--text, #14161f);
    line-height: 1.35;
}
.plan-card__features-tick {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(34, 197, 94, .12);
    color: #1f8a4d;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.05rem;
}

/* R15.1.c (правка 2026-05-07): выравнивание CTA по нижнему краю карточки.
   У SC одна цена, у Standard/Pro — size-toggle сверху, поэтому без `margin-top:auto`
   кнопка SC поднималась выше соседних. Карточки в .plan-grid (CSS Grid) и так
   тянутся по высоте до самой высокой, поэтому достаточно отдать кнопку «вниз». */
.plan-card__cta {
    margin-top: auto;
}

/* Карточка лимита на /teacher/students */
.students-limit-card {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.2rem 1.5rem;
    background: #fff;
    border: 1px solid var(--border, #e9eaf0);
    border-radius: 18px;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(20, 22, 35, .04));
}
.students-limit-card__icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: rgba(255, 138, 61, .12);
    color: var(--accent, #ff8a3d);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.students-limit-card__body { flex: 1; min-width: 0; }
.students-limit-card__title {
    font-weight: 700;
    color: var(--text, #14161f);
    font-size: 1rem;
    margin: 0 0 0.3rem 0;
}
.students-limit-card__progress { height: 6px; border-radius: 100px; background: #f0f1f5; overflow: hidden; margin-top: 0.4rem; }
.students-limit-card__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #ff8a3d), #ffb27a);
    transition: width 0.3s ease;
}
.students-limit-card__progress-bar--warn {
    background: linear-gradient(90deg, #ffb800, #ffd166);
}
.students-limit-card__progress-bar--full {
    background: linear-gradient(90deg, #c8332f, #ff5d57);
}
.students-limit-card__cta {
    flex-shrink: 0;
}

/* Read-only баннер при Status=Expired */
.billing-readonly-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.4rem;
    background: linear-gradient(90deg, rgba(200, 51, 47, .06), rgba(255, 93, 87, .04));
    border: 1px solid rgba(200, 51, 47, .25);
    border-radius: 18px;
    margin-bottom: 1.4rem;
}
.billing-readonly-banner__text { color: var(--text, #14161f); font-size: 0.95rem; }
.billing-readonly-banner__text strong { color: #c8332f; }
