/**
 * styles.css - SaaS Premium UI 2026 — Mobile-First Responsive
 */

/* ====== CSS Variables ====== */
:root {
    --lt-primary: #2B6CB0;
    --lt-primary-dark: #1e4e82;
    --lt-bg: #f8fafc;
    --lt-card-bg: #ffffff;
    --lt-text-main: #2d3748;
    --lt-text-muted: #718096;
    --lt-border: #e2e8f0;
    --lt-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    --lt-radius: 12px;
    --lt-success: #38a169;
}

/* ====== Container — clamps width, prevents overflow ====== */
.lt-calc-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--lt-text-main);
    max-width: 1000px;
    width: 100%;
    margin: 16px auto;
    line-height: 1.5;
    box-sizing: border-box;
    /* prevent the plugin from ever spilling outside its parent */
    overflow-x: hidden;
}

/* Make every child respect box-sizing */
.lt-calc-container *,
.lt-calc-container *::before,
.lt-calc-container *::after {
    box-sizing: border-box;
}

/* ====== Card shell ====== */
.lt-calc-card {
    background: var(--lt-card-bg);
    border-radius: var(--lt-radius);
    box-shadow: var(--lt-shadow);
    border: 1px solid var(--lt-border);
    overflow: hidden;
    width: 100%;
}

/* ====== Header ====== */
.lt-calc-header {
    background: var(--lt-primary);
    color: white;
    padding: 16px 20px;
}

.lt-calc-header h2 {
    margin: 0;
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 700;
    line-height: 1.3;
}

/* ====== Body: single column on mobile, two columns on desktop ====== */
.lt-calc-body {
    display: grid;
    grid-template-columns: 1fr;
    /* mobile-first: single column */
}

/* ====== LEFT SIDE: Inputs ====== */
.lt-calc-inputs {
    padding: 20px;
    border-right: none;
    /* no divider when stacked */
    border-bottom: 1px solid var(--lt-border);
}

.main-inputs .lt-field {
    margin-bottom: 16px;
}

.lt-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.lt-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.lt-input-wrapper input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 2px solid var(--lt-border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: border-color 0.2s;
    outline: none;
    min-width: 0;
    /* prevent flex children from overflowing */
}

.lt-input-wrapper input:focus {
    border-color: var(--lt-primary);
}

.lt-currency {
    position: absolute;
    right: 13px;
    font-weight: 700;
    color: var(--lt-text-muted);
    pointer-events: none;
}

/* ====== Settings grid — 1 col on very small, 2 cols at 400px+ ====== */
.lt-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* xs: 1 column */
    gap: 12px;
    margin-top: 16px;
}

@media (min-width: 400px) {
    .lt-settings-grid {
        grid-template-columns: 1fr 1fr;
        /* sm+: 2 columns */
    }
}

.lt-settings-box {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--lt-border);
}

.lt-settings-box h3 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
}

.lt-radio-stack,
.lt-checkbox-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lt-radio-stack label,
.lt-checkbox-stack label {
    font-size: 0.82rem;
    display: flex;
    align-items: flex-start;
    /* align-start so wrapped text looks good */
    gap: 7px;
    cursor: pointer;
    line-height: 1.4;
}

/* Ensure radio/checkbox don't shrink */
.lt-radio-stack label input[type="radio"],
.lt-checkbox-stack label input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ====== RIGHT SIDE: Results ====== */
.lt-calc-results {
    padding: 20px;
    background: #fbfcfe;
}

.lt-results-summary {
    margin-bottom: 20px;
}

.lt-res-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    /* allow wrap on very small screens */
}

.lt-res-row span {
    flex: 1;
    min-width: 0;
}

.lt-res-row strong {
    font-weight: 700;
    white-space: nowrap;
}

.lt-deduction {
    color: #e53e3e;
}

.lt-net-row,
.lt-total-row {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    color: var(--lt-primary);
    margin: 12px 0;
}

/* ====== MMA premium box ====== */
.lt-mma-premium-box {
    background: linear-gradient(135deg, #f0f7ff 0%, #e1effe 100%);
    border: 1px solid #c3dafe;
    border-radius: 12px;
    padding: 14px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.lt-mma-box-header {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--lt-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    text-align: center;
}

.lt-mma-box-grid {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    flex-wrap: wrap;
}

.lt-mma-box-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 80px;
}

.lt-mma-box-item span {
    font-size: 0.65rem;
    color: var(--lt-text-muted);
    margin-bottom: 4px;
    text-align: center;
}

.lt-mma-box-item strong {
    font-size: clamp(0.95rem, 3vw, 1.1rem);
    color: var(--lt-primary);
    font-weight: 800;
}

/* ====== Tooltip ====== */
.lt-tooltip {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--lt-border);
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    cursor: help;
    margin-left: 4px;
    flex-shrink: 0;
}

/* ====== Action buttons ====== */
.lt-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.lt-actions button {
    flex: 1;
    min-width: 130px;
    padding: 11px 12px;
    border: 1px solid var(--lt-primary);
    border-radius: 8px;
    background: white;
    color: var(--lt-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#lt-copy-btn {
    background: var(--lt-primary);
    color: white;
}

#lt-copy-btn:hover,
#lt-pdf-btn:hover {
    filter: brightness(0.9);
}

/* ====== Chart ====== */
.lt-chart-wrapper {
    margin: 16px 0;
    height: 160px;
    position: relative;
}

/* ====== Footer ====== */
.lt-calc-footer {
    padding: 16px 20px;
    font-size: 0.72rem;
    color: var(--lt-text-muted);
    border-top: 1px solid var(--lt-border);
    background: #ffffff;
    text-align: center;
}

/* ====== HR dividers ====== */
hr {
    border: 0;
    border-top: 1px solid var(--lt-border);
    margin: 10px 0;
}

/* ====== MMA info strip (legacy) ====== */
.lt-mma-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 10px;
    border: 1px solid #d0e6ff;
    margin-bottom: 20px;
}

.lt-mma-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 80px;
}

.lt-mma-item span {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--lt-primary);
    margin-bottom: 2px;
    opacity: 0.8;
    text-align: center;
}

.lt-mma-item strong {
    font-size: clamp(0.9rem, 3vw, 1rem);
    color: var(--lt-primary);
    font-weight: 800;
}

/* ============================================================
   BREAKPOINTS
   ============================================================ */

/* ── Tablet / small desktop: side-by-side two-column layout  */
@media (min-width: 640px) {
    .lt-calc-header {
        padding: 20px 28px;
    }

    .lt-calc-inputs {
        padding: 28px;
    }

    .lt-calc-results {
        padding: 28px;
    }

    .lt-calc-footer {
        padding: 20px 28px;
    }
}

@media (min-width: 768px) {
    .lt-calc-body {
        grid-template-columns: 1fr 1fr;
    }

    .lt-calc-inputs {
        border-right: 1px solid var(--lt-border);
        border-bottom: none;
    }

    .lt-chart-wrapper {
        height: 180px;
    }
}

/* ── Large desktop ────────────────────────────────────────── */
@media (min-width: 1024px) {
    .lt-calc-container {
        margin: 24px auto;
    }

    .lt-calc-header {
        padding: 22px 32px;
    }

    .lt-calc-inputs,
    .lt-calc-results {
        padding: 30px;
    }

    .lt-calc-footer {
        padding: 22px 32px;
    }
}