/* Student Loan Refinance Calculator Styles */
/* Prefix: slr- */

/* Reset and base styles - inherit from host site */
.slr-body {
    line-height: 1.6;
    color: #333;
}

.slr-body *,
.slr-body *::before,
.slr-body *::after {
    box-sizing: border-box;
}

/* Container */
.slr-container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow: visible;
}

/* Override CMS article width constraints */
.c-matter--article .slr-container {
    max-width: 1150px !important;
    width: 100% !important;
}

/* Header */
.slr-header {
    text-align: center;
    margin-bottom: 32px;
}

.slr-header p {
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    font-size: 1rem;
}

/* Calculator Layout - Two Column Grid */
.slr-calculator-layout {
    display: grid;
    grid-template-columns: 0.48fr 0.52fr;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    align-items: start;
}

.c-matter--article .slr-calculator-layout {
    display: grid;
    grid-template-columns: 0.48fr 0.52fr;
    gap: 24px;
}

/* Form Column */
.slr-form-column {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    transform: translateZ(0);
    will-change: transform;
}

@media (min-width: 751px) {
    .slr-form-column {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 20px !important;
        align-self: start !important;
        height: fit-content;
    }
}

.slr-form-column h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.3rem;
    color: #1e293b;
}

/* Input Section Headers */
.slr-section-header {
    margin-top: 24px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
}

.slr-section-header:first-of-type {
    margin-top: 0;
}

/* Input Groups */
.slr-input-section {
    margin-bottom: 20px;
}

.slr-input-group {
    margin-bottom: 16px;
}

.slr-input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
}

/* Input Wrapper */
.slr-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.slr-input-wrapper input {
    width: 100%;
    padding: 12px 16px;
    padding-left: 28px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.slr-input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.slr-input-wrapper input::placeholder {
    color: #9ca3af;
    opacity: 0.6;
}

/* No currency symbol - left padding normal */
.slr-input-wrapper.slr-no-currency input {
    padding-left: 16px;
}

/* Currency Symbol */
.slr-currency {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

/* Unit Symbol (%, months) */
.slr-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
}

.slr-input-wrapper:has(.slr-unit) input {
    padding-right: 70px;
}

.slr-input-wrapper:has(.slr-unit.slr-unit-short) input {
    padding-right: 35px;
}

.slr-unit-short {
    right: 12px;
}

/* Hide steppers by default */
.slr-input-wrapper input::-webkit-outer-spin-button,
.slr-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.slr-input-wrapper input[type="number"] {
    -moz-appearance: textfield;
}

/* Dual Input (Cost to Refinance) */
.slr-dual-input {
    display: flex;
    gap: 12px;
    align-items: center;
}

.slr-dual-input .slr-input-wrapper {
    flex: 1;
}

.slr-dual-input .slr-or-text {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

/* Tooltip */
.slr-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.slr-tooltip:hover {
    background: #3b82f6;
    color: #fff;
}

.slr-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: normal;
    width: 220px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    line-height: 1.4;
}

.slr-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
}

.slr-tooltip.active::after,
.slr-tooltip.active::before {
    opacity: 1;
    visibility: visible;
}

/* Disclaimer */
.slr-disclaimer-text {
    margin-top: 24px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f3f3f3;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* Download Section */
.slr-download-section {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.slr-download-section button {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.slr-start-over-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.slr-start-over-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.slr-download-btn {
    background: #3b82f6;
    border: 1px solid #3b82f6;
    color: #fff;
}

.slr-download-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Results Column */
.slr-results-column {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

/* Main Result Card */
.slr-main-result {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    margin-bottom: 24px;
    text-align: center;
}

.slr-main-result h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 500;
}

.slr-main-value {
    font-size: 3rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 12px;
    line-height: 1.1;
}

.slr-main-value.slr-negative {
    color: #dc2626;
}

.slr-explanation-text {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.slr-explanation-text span {
    font-weight: 600;
    color: #374151;
}

/* Results Grid */
.slr-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.slr-result-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.slr-result-card h3 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.slr-result-card .slr-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.slr-result-card .slr-value.slr-positive {
    color: #059669;
}

.slr-result-card .slr-value.slr-negative {
    color: #dc2626;
}

/* Breakdown Card */
.slr-breakdown {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    margin-bottom: 24px;
}

.slr-breakdown h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: #1e293b;
}

.slr-breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.slr-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.slr-breakdown-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.slr-breakdown-label {
    color: #64748b;
    font-size: 0.95rem;
}

.slr-breakdown-value {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.slr-breakdown-value.slr-positive {
    color: #059669;
}

.slr-breakdown-value.slr-negative {
    color: #dc2626;
}

/* Comparison Section */
.slr-comparison {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    margin-bottom: 24px;
}

.slr-comparison h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: #1e293b;
    text-align: center;
}

.slr-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.slr-comparison-column {
    text-align: center;
}

.slr-comparison-column h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slr-comparison-item {
    margin-bottom: 12px;
}

.slr-comparison-item:last-child {
    margin-bottom: 0;
}

.slr-comparison-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 4px;
}

.slr-comparison-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

/* Interpretation */
.slr-interpretation {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.slr-interpretation.slr-warning {
    background: #fef3c7;
    border-color: #fcd34d;
}

.slr-interpretation h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #0369a1;
}

.slr-interpretation.slr-warning h3 {
    color: #92400e;
}

.slr-interpretation p {
    margin: 0;
    color: #0c4a6e;
    font-size: 0.95rem;
    line-height: 1.6;
}

.slr-interpretation.slr-warning p {
    color: #78350f;
}

/* Mobile Buttons */
.slr-button-mobile {
    display: none;
    gap: 12px;
    margin-top: 24px;
}

.slr-button-mobile button {
    flex: 1;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 750px) {
    .slr-calculator-layout,
    .c-matter--article .slr-calculator-layout {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .slr-form-column {
        position: static !important;
    }
    
    .slr-results-column {
        min-height: 0 !important;
    }
    
    .slr-container {
        padding: 0 16px;
    }
    
    .slr-main-value {
        font-size: 2.5rem;
    }
    
    .slr-download-section {
        display: none;
    }
    
    .slr-button-mobile {
        display: flex;
        flex-direction: column;
    }
    
    .slr-results-grid {
        grid-template-columns: 1fr;
    }
    
    .slr-dual-input {
        flex-direction: column;
        gap: 8px;
    }
    
    .slr-dual-input .slr-or-text {
        text-align: center;
    }
    
    .slr-comparison-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

