/**
 * iTracker Pricing & Subscription Plans CSS
 * Ultra-Modern Design System with Full Modal Checkout Styles
 */

:root {
    --itp-primary: #ea580c;
    --itp-primary-hover: #c2410c;
    --itp-primary-light: rgba(234, 88, 12, 0.08);
    --itp-primary-glow: rgba(234, 88, 12, 0.25);
    --itp-bg: transparent;
    --itp-card-bg: #ffffff;
    --itp-card-border: #e2e8f0;
    --itp-card-radius: 24px;
    --itp-title-color: #0f172a;
    --itp-price-color: #0f172a;
    --itp-text-color: #64748b;
    --itp-feature-color: #334155;
    --itp-btn-bg: #ea580c;
    --itp-btn-hover-bg: #c2410c;
    --itp-btn-text: #ffffff;
    --itp-btn-radius: 14px;
    --itp-featured-border: #ea580c;
    --itp-featured-badge-bg: #ea580c;
    --itp-featured-badge-text: #ffffff;
}

body.itp-modal-locked {
    overflow: hidden !important;
}

.itracker-pricing-wrapper {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--itp-bg);
    padding: 32px 0;
}

.itracker-pricing-wrapper * {
    box-sizing: border-box;
}

/* ─── Toggle Switcher ─── */
.itp-toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 44px;
}

.itp-toggle-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--itp-text-color);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.itp-toggle-label.active {
    color: var(--itp-title-color);
    font-weight: 700;
}

.itp-toggle-switch {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 32px;
}

.itp-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.itp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.itp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.itp-toggle-switch input:checked + .itp-toggle-slider {
    background-color: var(--itp-primary);
}

.itp-toggle-switch input:checked + .itp-toggle-slider:before {
    transform: translateX(26px);
}

.itp-discount-pill {
    background: #ffedd5;
    color: var(--itp-primary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 20px;
    margin-left: 6px;
    display: inline-block;
}

/* ─── Cards Grid ─── */
.itp-cards-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    max-width: 1240px;
    margin: 0 auto;
    align-items: stretch;
}

.itp-cards-grid.cols-1 { grid-template-columns: minmax(290px, 440px); justify-content: center; }
.itp-cards-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 460px)); justify-content: center; }
.itp-cards-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.itp-cards-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ─── Individual Card ─── */
.itp-card {
    background: var(--itp-card-bg);
    border: 1px solid var(--itp-card-border);
    border-radius: var(--itp-card-radius);
    padding: 36px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.itp-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(234, 88, 12, 0.35);
}

.itp-card.featured {
    border: 2px solid var(--itp-featured-border);
    box-shadow: 0 12px 30px rgba(234, 88, 12, 0.12);
}

.itp-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--itp-featured-badge-bg);
    color: var(--itp-featured-badge-text);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
    white-space: nowrap;
}

.itp-plan-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--itp-title-color);
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}

.itp-plan-desc {
    font-size: 14px;
    color: var(--itp-text-color);
    margin: 0 0 20px 0;
    line-height: 1.5;
    min-height: 42px;
}

.itp-price-box {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 6px;
}

.itp-currency {
    font-size: 24px;
    font-weight: 700;
    color: var(--itp-price-color);
}

.itp-amount {
    font-size: 42px;
    font-weight: 900;
    color: var(--itp-price-color);
    letter-spacing: -1px;
    line-height: 1;
}

.itp-period {
    font-size: 13px;
    font-weight: 500;
    color: var(--itp-text-color);
    margin-left: 4px;
}

.itp-regular-price {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
    margin-bottom: 12px;
    font-weight: 500;
}

.itp-user-limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--itp-primary);
    background: var(--itp-primary-light);
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 22px;
}

.itp-divider {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 16px 0 22px 0;
}

.itp-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
}

.itp-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--itp-feature-color);
    margin-bottom: 12px;
    line-height: 1.45;
}

.itp-check {
    color: var(--itp-primary);
    font-weight: 900;
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1.4;
}

.itp-cta-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: var(--itp-btn-bg);
    color: var(--itp-btn-text) !important;
    text-decoration: none !important;
    border-radius: var(--itp-btn-radius);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--itp-primary-glow);
}

.itp-cta-btn:hover {
    background: var(--itp-btn-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--itp-primary-glow);
}

/* ═══════════════════════════════════════════════════════════════════
   IN-PAGE MODAL SYSTEM (Checkout & Registration Dialog)
   ═══════════════════════════════════════════════════════════════════ */

.itp-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.itp-modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.itp-modal-content {
    background: #ffffff;
    border-radius: 24px;
    max-width: 540px;
    width: 100%;
    padding: 34px 32px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.itp-modal-backdrop.open .itp-modal-content {
    transform: scale(1) translateY(0);
}

.itp-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #64748b;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.itp-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.itp-modal-header {
    margin-bottom: 20px;
    text-align: left;
}

.itp-modal-plan-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #ffedd5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.itp-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ea580c;
}

.itp-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.itp-modal-subtitle {
    color: #64748b;
    font-size: 13px;
    margin: 0;
    line-height: 1.45;
}

/* Modal Billing Switcher Tabs */
.itp-modal-cycle-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 22px;
}

.itp-cycle-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.itp-cycle-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.itp-cycle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: #475569;
}

.itp-cycle-rate {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.itp-cycle-option:has(input:checked) {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.itp-cycle-option:has(input:checked) .itp-cycle-text {
    color: #0f172a;
    font-weight: 700;
}

.itp-cycle-option:has(input:checked) .itp-cycle-rate {
    color: #ea580c;
    font-weight: 600;
}

.itp-save-tag {
    background: #16a34a;
    color: #ffffff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 800;
    margin-left: 4px;
}

/* Form Fields */
.itp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

@media (max-width: 520px) {
    .itp-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.itp-form-group {
    text-align: left;
}

.itp-form-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.itp-help-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #475569;
    font-size: 10px;
    cursor: help;
}

.itp-form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.itp-form-group input:focus {
    outline: none;
    border-color: var(--itp-primary);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.itp-input-pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.itp-input-pass-wrap input {
    padding-right: 40px;
}

.itp-pass-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    padding: 4px;
    line-height: 1;
}

/* Order Summary Box */
.itp-order-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    margin: 18px 0 20px 0;
}

.itp-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.itp-summary-label {
    color: #64748b;
}

.itp-summary-val {
    font-weight: 600;
    color: #1e293b;
}

.itp-summary-divider {
    border-top: 1px dashed #cbd5e1;
    margin: 10px 0;
}

.itp-summary-total {
    margin-bottom: 0;
    align-items: center;
}

.itp-summary-total .itp-summary-label {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
}

.itp-total-amount {
    font-size: 20px !important;
    font-weight: 900 !important;
    color: var(--itp-primary) !important;
}

/* Modal Status Message */
.itp-modal-status {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    line-height: 1.45;
}

.itp-modal-status.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.itp-modal-status.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Submit Button & Spinner */
.itp-modal-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
}

.itp-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: itp-spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes itp-spin {
    to { transform: rotate(360deg); }
}

.itp-trust-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   SUCCESS STATE SCREEN
   ═══════════════════════════════════════════════════════════════════ */

#itp-modal-success-view {
    text-align: center;
    padding: 10px 0;
}

.itp-success-icon-wrap {
    margin-bottom: 18px;
}

.itp-success-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35);
}

.itp-success-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.itp-success-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 22px 0;
}

.itp-success-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.itp-success-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

.itp-success-row:last-child {
    border-bottom: none;
}

.itp-success-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.itp-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 12px 20px;
    border-radius: var(--itp-btn-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.itp-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}
