/* ==================== BASE ==================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    color: #2c3e50;
    line-height: 1.5;
    background: #f4f7f6;
}

/* ==================== CONTROL PANEL ==================== */
.no-print {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.app-title {
    margin: 0;
    color: #2980b9;
}

.intro-banner {
    background: #e0f2fe;
    border-left: 4px solid #0284c7;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 4px;
    font-size: 14px;
    color: #0c4a6e;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.disclaimer {
    margin-top: 8px;
    font-size: 11px;
    opacity: 0.8;
    font-style: italic;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: bold;
    color: #34495e;
}

.input-group input,
.input-group select {
    padding: 8px;
    margin-top: 4px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 13px;
}

.select-astig {
    border: 2px solid #d35400;
}

.lifestyle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #bdc3c7;
    margin-bottom: 15px;
}

.btn-print {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-print:hover {
    background: #219a52;
}

/* ==================== UPSELL BANNER ==================== */
.upsell-banner {
    margin-top: 25px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.upsell-text {
    flex: 1;
    min-width: 250px;
}

.upsell-text h4 {
    color: #38bdf8;
    margin: 0 0 5px 0;
    font-size: 15px;
}

.upsell-text p {
    color: #cbd5e1;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.upsell-cta {
    background: #38bdf8;
    color: #0f172a;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 13px;
    transition: background 0.2s;
    white-space: nowrap;
}

.upsell-cta:hover {
    background: #7dd3fc;
}

/* ==================== HANDOUT ==================== */
#handout {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
}

.handout-title {
    text-align: center;
    margin-bottom: 5px;
    color: #2c3e50;
}

.patient-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.eye-value {
    font-weight: bold;
    color: #2980b9;
}

.toric-value {
    font-weight: bold;
}

.segment {
    margin-top: 25px;
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 8px;
    background: #fafafa;
    page-break-inside: avoid;
}

.segment-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    border-bottom: 2px solid #bdc3c7;
    padding-bottom: 5px;
    color: #34495e;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.card {
    border: 1px solid #dcdde1;
    padding: 15px;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card b {
    font-size: 14px;
    color: #2f3640;
    margin-bottom: 4px;
}

.card-type {
    font-size: 10px;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: bold;
}

.card-usp {
    font-size: 11px;
    color: #8e44ad;
    font-style: italic;
    margin: 5px 0;
    padding-left: 6px;
    border-left: 2px solid #8e44ad;
}

.card-usp b {
    color: #8e44ad;
}

.score-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f39c12;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

.economy-border { border-top: 4px solid #7f8c8d; }
.standard-border { border-top: 4px solid #2980b9; }
.premium-border { border-top: 4px solid #8e44ad; }

.badge-patho {
    background: #e74c3c;
    color: white;
    padding: 6px;
    font-weight: bold;
    display: none;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 12px;
}

.toric-note {
    font-size: 11px;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 10px;
}

.footer {
    margin-top: 40px;
    font-size: 11px;
    border-top: 1px solid #eee;
    padding-top: 15px;
    color: #7f8c8d;
    display: flex;
    justify-content: space-between;
}

.brand-footer {
    text-align: center;
    margin-top: 25px;
}

.brand-footer.print-only {
    margin-top: 15px;
    font-size: 10px;
    color: #95a5a6;
}

.brand-pill {
    text-decoration: none;
    display: inline-block;
    background: #ecfdf5;
    color: #059669;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid #a7f3d0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.brand-pill:hover {
    transform: translateY(-1px);
}

/* ==================== PRINT-ONLY HELPERS ==================== */
.print-only { display: none; }

/* ==================== PRINT ==================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .no-print { display: none !important; }
    .score-badge { display: none; }

    #handout {
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }

    @page {
        size: A4;
        margin: 8mm;
    }

    .handout-title {
        margin-bottom: 2px !important;
        font-size: 18px;
    }

    .segment {
        margin-top: 10px;
        padding: 10px;
    }

    .segment-title {
        margin: 0 0 8px 0;
        font-size: 13px;
    }

    .grid { gap: 10px; }

    .card {
        padding: 8px;
        font-size: 11px;
    }

    .card b {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .card-type {
        margin-bottom: 4px;
        font-size: 9px;
    }

    .patient-header {
        padding-bottom: 2px !important;
        margin-bottom: 10px !important;
        font-size: 12px !important;
    }

    .footer {
        margin-top: 15px;
        padding-top: 10px;
        font-size: 10px;
    }

    .print-only { display: block !important; }
}

/* ==================== MOBILE ==================== */
@media (max-width: 700px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .controls,
    .lifestyle-grid {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .input-group input,
    .input-group select {
        padding: 12px;
        font-size: 14px;
    }

    .btn-print {
        width: 100%;
        padding: 15px;
        margin-bottom: 10px;
    }

    .upsell-cta {
        width: 100%;
        text-align: center;
        display: block;
    }
}