/* Tutor Installment Plugin — Frontend Styles (Responsive v11 — Brand #ff6600)
   Mobile-first, single source of truth via CSS variables.
   Breakpoints scale the variables only — no layout re-architecture per
   breakpoint, so spacing/typography stay consistent across phone,
   tablet and desktop. */

:root {
    --emi-orange: #ff6600;
    --emi-orange-dark: #e55a00;
    --emi-text: #1a202c;
    --emi-text-muted: #718096;
    --emi-text-soft: #4a5568;
    --emi-border: #e5e7eb;
    --emi-radius: 12px;
    --emi-radius-sm: 8px;

    /* Type scale */
    --emi-fs-xs: 11px;
    --emi-fs-sm: 12px;
    --emi-fs-base: 13px;
    --emi-fs-md: 14px;
    --emi-fs-lg: 16px;
    --emi-fs-xl: 20px;
    --emi-fs-2xl: 24px;

    /* Spacing */
    --emi-gap: 8px;
    --emi-pad: 16px;
}

@media screen and (min-width: 481px) {
    :root {
        --emi-fs-xs: 11px;
        --emi-fs-sm: 12px;
        --emi-fs-base: 13px;
        --emi-fs-md: 14px;
        --emi-fs-lg: 17px;
        --emi-fs-xl: 22px;
        --emi-fs-2xl: 26px;
        --emi-gap: 10px;
        --emi-pad: 20px;
    }
}

@media screen and (min-width: 1024px) {
    :root {
        --emi-fs-lg: 18px;
        --emi-fs-xl: 24px;
        --emi-fs-2xl: 28px;
        --emi-pad: 24px;
    }
}

* { box-sizing: border-box; }

/* ══════════════════════════════════════════════════════
   BOX WRAPPER
══════════════════════════════════════════════════════ */
.tutor-emi-box {
    margin-top: 12px;
    padding: var(--emi-pad);
    border: 2px solid var(--emi-border);
    border-radius: var(--emi-radius);
    background: #ffffff;
    font-size: var(--emi-fs-md);
    line-height: 1.5;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.tutor-emi-box--overdue {
    border-color: #ffaa80;
    background: #fff7f2;
}

.tutor-emi-box--completed {
    border-color: #68d391;
    background: #f0fff4;
}

.tutor-emi-box--new {
    padding-top: 0 !important;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════ */
.tutor-emi-box__header {
    display: flex;
    align-items: center;
    gap: var(--emi-gap);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tutor-emi-box__icon {
    font-size: var(--emi-fs-xl);
    flex-shrink: 0;
}

.tutor-emi-box__title {
    font-size: var(--emi-fs-lg);
    font-weight: 700;
    color: var(--emi-text);
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.tutor-emi-box__subtitle {
    color: var(--emi-text-soft);
    margin: 0 0 14px;
    font-size: var(--emi-fs-base);
    word-break: break-word;
}

/* ══════════════════════════════════════════════════════
   OR DIVIDER
══════════════════════════════════════════════════════ */
.tutor-emi-or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 10px;
}

.tutor-emi-or-divider__line {
    flex: 1;
    height: 1px;
    background: var(--emi-border);
}

.tutor-emi-or-divider__text {
    font-size: var(--emi-fs-base);
    font-weight: 700;
    color: #6b7280;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 0 4px;
}

/* ══════════════════════════════════════════════════════
   META ROWS — label left, value right, all breakpoints
══════════════════════════════════════════════════════ */
.tutor-emi-meta-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    color: var(--emi-text-soft);
}

.tutor-emi-meta-row:last-child {
    border-bottom: none;
}

.tutor-emi-meta-row > span:first-child {
    font-size: var(--emi-fs-base);
    color: var(--emi-text-muted);
    line-height: 1.4;
}

.tutor-emi-meta-row > strong {
    max-width: 100%;
    text-align: left;
    display: block;
    line-height: 1.4;
    font-size: var(--emi-fs-md);
    font-weight: 700;
    color: var(--emi-text);
    word-break: break-word;
}

.tutor-emi-meta-row--highlight strong {
    color: var(--emi-orange);
}

.tutor-emi-box__meta {
    margin-bottom: 14px;
}

/* ══════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════ */
.tutor-emi-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: var(--emi-fs-xs);
    font-weight: 600;
    white-space: nowrap;
}

.tutor-emi-badge--green  { background: #c6f6d5; color: #276749; }
.tutor-emi-badge--orange { background: #ffe4d4; color: #cc5200; }
.tutor-emi-badge--blue   { background: #bee3f8; color: #2b6cb0; }
.tutor-emi-badge--red    { background: #ffe4d4; color: #cc5200; }

/* ══════════════════════════════════════════════════════
   PLAN CARDS — grid that scales smoothly with viewport
══════════════════════════════════════════════════════ */
.tutor-emi-plans {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--emi-gap);
    margin-bottom: 14px;
}

@media screen and (min-width: 481px) and (max-width: 1023px) {
    .tutor-emi-plans {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (min-width: 1024px) {
    .tutor-emi-plans {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* Single plan — center it, fixed width on all sizes */
.tutor-emi-plans--single {
    grid-template-columns: 1fr !important;
    max-width: 180px !important;
    margin: 0 auto !important;
    justify-items: center;
}

.tutor-emi-plan-card {
    cursor: pointer;
    min-width: 0;
}

.tutor-emi-plan-card input[type="radio"] {
    display: none;
}

.tutor-emi-plan-card__inner {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    user-select: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}

.tutor-emi-plan-card:hover .tutor-emi-plan-card__inner {
    border-color: #ffb380;
    background: #fff8f4;
}

.tutor-emi-plan-card.selected .tutor-emi-plan-card__inner,
.tutor-emi-plan-card input:checked ~ .tutor-emi-plan-card__inner {
    border-color: var(--emi-orange);
    background: #fff4ee;
    box-shadow: 0 0 0 3px rgba(255,96,0,.15);
}

/* Number + "Installments" label, stacked */
.tutor-emi-plan-card__months {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    line-height: 1.2;
}

/* ── Container Query: card ki actual width ke saath sab fonts scale honge ──
   cqi = 1% of the card's own width — viewport ya screen se koi lena dena nahi.
   Card chahe mobile mein ho, desktop sidebar mein, ya wide screen pe — sab
   automatically adjust hoga. Koi hardcoded breakpoint nahi. ── */
.tutor-emi-plan-card__inner {
    container-type: inline-size; /* card khud ek container ban jaata hai */
}

/* Installment number: 6, 12, 24 — card width ka ~12% */
.tutor-emi-plan-card__months-num {
    font-size: clamp(16px, 12cqi, 24px);
    font-weight: 800;
    color: var(--emi-text);
    line-height: 1;
}

/* "Installments" label */
.tutor-emi-plan-card__months-label {
    font-size: clamp(10px, 4cqi, 12px);
    font-weight: 600;
    color: var(--emi-text-soft);
    white-space: nowrap;
}

/* "Today" label */
.tutor-emi-plan-card__today-label {
    font-size: clamp(10px, 3.5cqi, 11px);
    color: var(--emi-text-muted);
    margin-top: 2px;
}

/* Price amount — ₹100 se ₹10,00,000 tak: card width ke saath shrinks */
.tutor-emi-plan-card__down-amount {
    font-size: clamp(13px, 9cqi, 18px);
    font-weight: 800;
    color: var(--emi-orange);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* "then ₹X/Installment" — <wbr> after "/" handles break if truly needed */
.tutor-emi-plan-card__monthly {
    font-size: clamp(10px, 3.5cqi, 11px);
    color: var(--emi-text-muted);
    line-height: 1.4;
    max-width: 100%;
    text-align: center;
}

/* installments count bottom */
.tutor-emi-plan-card__total {
    font-size: clamp(10px, 3cqi, 11px);
    color: #a0aec0;
    margin-top: 4px;
    border-top: 1px solid #f0f0f0;
    padding-top: 4px;
    width: 100%;
}

/* "Pay every" interval pill on each card */
.tutor-emi-plan-card__interval {
    margin-top: 2px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 3px 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3px;
    max-width: 100%;
}

.tutor-emi-plan-card__interval-label {
    font-size: clamp(10px, 3cqi, 11px);
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}

.tutor-emi-plan-card__interval-value {
    font-size: clamp(11px, 4cqi, 13px);
    color: #1d4ed8;
    font-weight: 800;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════
   SUMMARY
══════════════════════════════════════════════════════ */
.tutor-emi-summary {
    background: #fff8f4;
    border-radius: var(--emi-radius-sm);
    padding: 12px 14px;
    margin-bottom: 14px;
    animation: emiSlideFade .25s ease;
}

@keyframes emiSlideFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════
   ACCESS NOTE
══════════════════════════════════════════════════════ */
.tutor-emi-access-note {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--emi-radius-sm);
    padding: 10px 14px;
    margin-top: 10px;
    font-size: var(--emi-fs-base);
    color: #15803d;
    line-height: 1.6;
    text-align: center;
}

.tutor-emi-access-note__sub {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: var(--emi-fs-sm);
}

/* ══════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════ */
.tutor-emi-btn {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--emi-radius-sm);
    border: none;
    font-size: var(--emi-fs-md);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    margin-top: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.tutor-emi-btn--locked,
.tutor-emi-btn[disabled] {
    background: #cbd5e0 !important;
    color: #718096 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    transform: none !important;
    pointer-events: auto;
}

.tutor-emi-btn--primary {
    background: var(--emi-orange);
    color: #ffffff !important;
}

.tutor-emi-btn--primary:not([disabled]):hover {
    background: var(--emi-orange-dark);
    transform: translateY(-1px);
}

.tutor-emi-btn--secondary {
    background: #fff4ee;
    color: #cc5200 !important;
    border: 2px solid #ffb380;
}

.tutor-emi-btn--secondary:hover {
    background: #ffe4d4;
}

/* ══════════════════════════════════════════════════════
   FINE PRINT & NOTICE
══════════════════════════════════════════════════════ */
.tutor-emi-box__fine-print {
    font-size: var(--emi-fs-xs);
    color: #a0aec0;
    margin-top: 10px;
    text-align: center;
    word-break: break-word;
}

.tutor-emi-box__notice {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: var(--emi-fs-base);
    word-break: break-word;
}

.tutor-emi-box__notice--error {
    background: #fff4ee;
    color: #cc5200;
    border: 1px solid #ffb380;
}

/* ══════════════════════════════════════════════════════
   CHECKOUT INSTALLMENT PLAN
══════════════════════════════════════════════════════ */
.tutor-emi-checkout-plan {
    background: #fff8f4;
    border: 1px solid #ffcbaa;
    border-radius: var(--emi-radius-sm);
    padding: 12px 14px;
    margin-top: 8px;
    font-size: var(--emi-fs-md);
    word-break: break-word;
}

.tutor-emi-checkout-plan p {
    margin: 0 0 8px;
}

.tutor-emi-checkout-plan ul li {
    padding: 3px 0;
    color: var(--emi-text-soft);
}

/* ══════════════════════════════════════════════════════
   COMPACT STRIP (collapsed header)
══════════════════════════════════════════════════════ */
.tutor-emi-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--emi-pad);
    cursor: pointer;
    text-align: center;
    background: #000000;
    position: relative;
    overflow: hidden;
}

.tutor-emi-strip__shimmer {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,#ff6600,#ff8800,#ff8533,#ff8800,#ff6600);
    background-size: 200% 100%;
    animation: emiShimmer 2.5s linear infinite;
}

@keyframes emiShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.tutor-emi-strip__badge {
    background: #ffffff;
    color: #cc5200;
    font-size: var(--emi-fs-xs);
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: .5px;
}

.tutor-emi-strip__headline {
    font-size: var(--emi-fs-lg);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.3;
    max-width: 36ch;
}

.tutor-emi-strip__cta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.tutor-emi-strip__cta-text {
    font-size: var(--emi-fs-base);
    font-weight: 700;
    color: #ff8533;
}

.tutor-emi-strip__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: var(--emi-fs-sm);
    transition: transform .25s ease;
    transform: rotate(180deg);
}

/* ══════════════════════════════════════════════════════
   EXPAND BODY
══════════════════════════════════════════════════════ */
.tutor-emi-expand-body {
    display: none;
    overflow: hidden;
    background: #fff;
    padding: var(--emi-pad) var(--emi-pad) calc(var(--emi-pad) - 4px);
}

.tutor-emi-expand-body.tutor-emi-expanded {
    display: block;
    animation: emiSlideDown .22s ease;
}

@keyframes emiSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tutor-emi-expand-inner {
    padding-top: 16px;
}

.tutor-emi-trust-text {
    margin-bottom: 14px;
    text-align: center;
    font-size: var(--emi-fs-base);
    color: #374151;
    line-height: 1.6;
}

.tutor-emi-trust-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 12px;
}

.tutor-emi-trust-bar span {
    font-size: var(--emi-fs-xs);
    color: var(--emi-text-soft);
    font-weight: 500;
}

.tutor-emi-expand-subtitle {
    font-size: var(--emi-fs-base);
    color: var(--emi-text-soft);
    margin: 0 0 14px;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════
   ENROLL BOX (outer wrapper)
══════════════════════════════════════════════════════ */
.tutor-emi-enroll-box {
    margin-top: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid var(--emi-border);
}
