/* UFPLS vs Drawdown CSS - Matching Design System */

.ufplsd-container {
    margin: 2rem auto;
    width: 100%;
    max-width: 1400px;
    padding: 0 1rem;
    box-sizing: border-box;
}

.ufplsd-app {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #083141;
    background: #ffffff;
    border: 1px solid #e0eaef;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 15px;
}

/* Header */
.ufplsd-header {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0eaef;
}

.ufplsd-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #083141;
    margin: 0 0 1rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.ufplsd-header p {
    font-size: 0.95rem;
    color: #526b75;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 1rem;
}

.ufplsd-comparison-note {
    background: #f8fafc;
    border: 1px solid #d5e4eb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: #083141;
    font-size: 0.9rem;
}

.ufplsd-comparison-note strong {
    color: #083141;
    font-weight: 700;
}

/* Step Panels */
.ufplsd-step {
    background: #ffffff;
    border: 1px solid #d5e4eb;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.25rem;
    transition: box-shadow 0.2s ease;
}

.ufplsd-step:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ufplsd-step-header {
    background: #f8fafc;
    border-bottom: 1px solid #e0eaef;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
}

.ufplsd-step-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    color: #083141;
    letter-spacing: -0.01em;
}

.ufplsd-step-help {
    color: #526b75;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

.ufplsd-step-body {
    padding: 1.2rem 1.5rem;
}

/* Grids */
.ufplsd-grid {
    display: grid;
    gap: 1rem 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: start;
}

@media (max-width: 768px) {
    .ufplsd-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.ufplsd-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.ufplsd-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Form Fields */
.ufplsd-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    align-items: flex-start;
}

.ufplsd-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 0;
}

.ufplsd-input {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    outline: none;
    min-height: 38px;
    font-family: inherit;
    line-height: 1.5;
}

.ufplsd-input:focus {
    outline: none;
    border-color: #59747c;
    box-shadow: 0 0 0 2px rgba(89, 116, 124, 0.2);
    background: #f8fafc;
}

.ufplsd-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.ufplsd-prefix {
    position: absolute;
    left: 0.55rem;
    color: #526b75;
    font-weight: 600;
    pointer-events: none;
    font-size: 0.9rem;
}

.ufplsd-prefix + .ufplsd-input {
    padding-left: 2rem;
}

.ufplsd-suffix {
    position: absolute;
    right: 0.55rem;
    color: #526b75;
    font-weight: 600;
    pointer-events: none;
    font-size: 0.9rem;
}

.ufplsd-input + .ufplsd-suffix {
    padding-right: 2rem;
}

.ufplsd-field--checkbox {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
}

.ufplsd-field--checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
    line-height: 1.4;
}

.ufplsd-field--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    accent-color: #59747c;
    cursor: pointer;
}

/* Info Boxes */
.ufplsd-info-box {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #59747c;
    background: #f8fafc;
    color: #083141;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 1rem;
}

.ufplsd-info-box strong {
    color: #083141;
    font-weight: 700;
}

/* Results Section */
.ufplsd-results {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #d5e4eb;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ufplsd-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ufplsd-results-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #083141;
    letter-spacing: -0.01em;
}

.ufplsd-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ufplsd-btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    border: 1px solid #59747c;
    background: #edf3f5;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    min-height: 36px;
    color: #083141;
}

.ufplsd-btn:hover {
    background: #dde7eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ufplsd-btn--primary {
    background: #59747c;
    color: #ffffff;
    border-color: #59747c;
    font-weight: 600;
}

.ufplsd-btn--primary:hover {
    background: #476069;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(89, 116, 124, 0.3);
}

.ufplsd-disclaimer {
    padding: 1rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    color: #78350f;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Summary Cards */
.ufplsd-summary-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.ufplsd-summary-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 800px) {
    .ufplsd-summary-grid-3 {
        grid-template-columns: 1fr;
    }
}

.ufplsd-summary-card {
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #d5e4eb;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease;
}

.ufplsd-summary-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ufplsd-summary-card h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0eaef;
    letter-spacing: -0.01em;
}

.ufplsd-summary--a {
    border-top: 4px solid #59747c;
}

.ufplsd-summary--a h3 {
    color: #59747c;
}

.ufplsd-summary--b {
    border-top: 4px solid #10b981;
}

.ufplsd-summary--b h3 {
    color: #10b981;
}

.ufplsd-summary--c {
    border-top: 4px solid #f59e0b;
}

.ufplsd-summary--c h3 {
    color: #f59e0b;
}

.ufplsd-summary-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ufplsd-summary-card li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0eaef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 2.5rem;
}

.ufplsd-summary-card li:last-child {
    border-bottom: none;
}

.ufplsd-summary-card li span {
    color: #526b75;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
}

.ufplsd-summary-card li strong {
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
    color: #083141;
    white-space: nowrap;
}

.ufplsd-summary-highlight {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #59747c;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 0.5rem -1rem;
}

.ufplsd-summary-highlight span {
    color: #083141;
    font-weight: 600;
}

.ufplsd-summary-highlight strong {
    color: #59747c;
}

.ufplsd-summary-sustainable {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #10b981;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 0.5rem -1rem;
}

.ufplsd-summary-sustainable span {
    color: #083141;
    font-weight: 600;
}

.ufplsd-summary-sustainable strong {
    color: #059669;
}

.ufplsd-tfls-note {
    background: #f8fafc;
    border-left: 4px solid #59747c;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    color: #083141;
    font-size: 0.9rem;
    line-height: 1.6;
    page-break-inside: avoid;
    break-inside: avoid;
}

.ufplsd-tfls-note strong {
    color: #083141;
    font-weight: 700;
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.ufplsd-tfls-note p {
    margin: 0.75rem 0;
    line-height: 1.6;
}

.ufplsd-tfls-note p:first-of-type {
    margin-top: 0;
}

.ufplsd-tfls-note p:last-child {
    margin-bottom: 0;
}

.ufplsd-tfls-note-footer {
    font-size: 0.85rem;
    color: #526b75;
    font-style: italic;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0eaef;
}

/* Pros/Cons */
.ufplsd-pros-cons {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0eaef;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 800px) {
    .ufplsd-pros-cons {
        grid-template-columns: 1fr;
    }
}

.ufplsd-pros,
.ufplsd-cons {
    padding: 1rem;
    border-radius: 8px;
}

.ufplsd-pros {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
}

.ufplsd-cons {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.ufplsd-pros strong,
.ufplsd-cons strong {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #083141;
    font-weight: 700;
}

.ufplsd-pros ul,
.ufplsd-cons ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.ufplsd-pros li,
.ufplsd-cons li {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #526b75;
}

/* Outcome Metrics */
.ufplsd-outcome-metrics {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #d5e4eb;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ufplsd-outcome-metrics h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #083141;
    margin: 0 0 1.5rem;
    text-align: center;
    letter-spacing: -0.01em;
}

.ufplsd-financial-winner {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    text-align: center;
}

.ufplsd-financial-winner h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: #78350f;
}

.ufplsd-financial-winner p {
    margin: 0;
    font-size: 1rem;
    color: #92400e;
    font-weight: 600;
}

.ufplsd-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.ufplsd-metric-card {
    padding: 1.25rem;
    border-radius: 10px;
    border: 2px solid #d5e4eb;
    background: #ffffff;
    transition: all 0.2s;
    position: relative;
}

.ufplsd-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Different styling for each metric card type */
.ufplsd-metric-card--income {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #3b82f6;
    border-top: 4px solid #3b82f6;
}

.ufplsd-metric-card--tax {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
    border-top: 4px solid #ef4444;
}

.ufplsd-metric-card--longevity {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #10b981;
    border-top: 4px solid #10b981;
}

.ufplsd-metric-card--taxfree {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    border-top: 4px solid #f59e0b;
}

/* Winner states override base colors */
.ufplsd-metric-card.ufplsd-winner {
    border-color: #59747c;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7fa 100%);
    box-shadow: 0 4px 16px rgba(89, 116, 124, 0.2);
    border-top: 4px solid #59747c;
}

.ufplsd-metric-card.ufplsd-winner-secondary {
    border-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
    border-top: 4px solid #10b981;
}

.ufplsd-metric-card.ufplsd-winner-annuity {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
    border-top: 4px solid #f59e0b;
}

.ufplsd-metric-label {
    font-size: 0.85rem;
    color: #526b75;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ufplsd-metric-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #083141;
    margin-bottom: 0.5rem;
}

.ufplsd-metric-detail {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
}

/* Comparison Summary Section */
.ufplsd-comparison-summary {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #d5e4eb;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ufplsd-comparison-summary h2 {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #083141;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: -0.01em;
}

.ufplsd-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 800px) {
    .ufplsd-comparison-grid {
        grid-template-columns: 1fr;
    }
}

.ufplsd-comparison-card {
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #d5e4eb;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease;
}

.ufplsd-comparison-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ufplsd-comparison-card--ufpls {
    border-top: 4px solid #59747c;
}

.ufplsd-comparison-card--fad {
    border-top: 4px solid #10b981;
}

.ufplsd-comparison-card--annuity {
    border-top: 4px solid #f59e0b;
}

.ufplsd-comparison-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: #083141;
    letter-spacing: -0.01em;
}

.ufplsd-comparison-card--ufpls h3 {
    color: #59747c;
}

.ufplsd-comparison-card--fad h3 {
    color: #10b981;
}

.ufplsd-comparison-card--annuity h3 {
    color: #f59e0b;
}

.ufplsd-comparison-subtitle {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

.ufplsd-comparison-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ufplsd-comparison-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0eaef;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.ufplsd-comparison-list li:last-child {
    border-bottom: none;
}

.ufplsd-comparison-label {
    font-weight: 600;
    color: #083141;
    flex: 1;
    min-width: 140px;
    font-size: 0.9rem;
}

.ufplsd-comparison-value {
    font-weight: 700;
    color: #083141;
    text-align: right;
    flex: 0 0 auto;
    font-size: 0.95rem;
}

.ufplsd-comparison-note {
    font-size: 0.8rem;
    color: #64748b;
    font-style: italic;
    width: 100%;
    margin-top: 0.25rem;
    padding-left: 0;
}

.ufplsd-comparison-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e0eaef !important;
    font-size: 0.85rem;
    color: #526b75;
    line-height: 1.6;
}

.ufplsd-comparison-info strong {
    color: #083141;
    font-weight: 700;
}

.ufplsd-insights-section {
    margin-top: 2rem;
}

.ufplsd-insights {
    padding: 1.5rem;
    background: #f8fafc;
    border-left: 4px solid #59747c;
    border-radius: 8px;
}

.ufplsd-insights h3 {
    margin-top: 0;
    color: #083141;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ufplsd-insights ul {
    margin: 1rem 0 0;
    padding-left: 1.5rem;
    line-height: 1.8;
}

.ufplsd-insights li {
    margin-bottom: 0.75rem;
    color: #083141;
    font-size: 0.9rem;
}

.ufplsd-insights li:last-child {
    margin-bottom: 0;
    font-style: italic;
    color: #526b75;
}

.ufplsd-insights strong {
    color: #083141;
    font-weight: 700;
}

/* Tables */
.ufplsd-tables {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #d5e4eb;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ufplsd-tables h2 {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #083141;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: -0.01em;
}

.ufplsd-table-intro {
    color: #083141;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-left: 4px solid #59747c;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.ufplsd-table-wrap {
    margin-top: 1.5rem;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #d5e4eb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.ufplsd-table-wrap h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: #083141;
    font-weight: 700;
    padding: 0 1rem;
    padding-top: 1rem;
    letter-spacing: -0.01em;
}

.ufplsd-table-help {
    font-size: 0.85rem;
    color: #526b75;
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

.ufplsd-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.ufplsd-table th {
    background: #f8fafc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 700;
    color: #083141;
    border-bottom: 2px solid #e0eaef;
    font-size: 0.85rem;
    white-space: nowrap;
}

.ufplsd-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0eaef;
    color: #526b75;
    font-size: 0.85rem;
}

.ufplsd-table tr:hover {
    background: #f8fafc;
}

.ufplsd-table tr:last-child td {
    border-bottom: none;
}

/* Print Styles */
@media print {
    .ufplsd-actions,
    .ufplsd-btn {
        display: none;
    }
    
    .ufplsd-step {
        page-break-inside: avoid;
    }
}
