/* Financing Widget Styles */

/* Trigger Button */
.hf-trigger-button {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 56px;
    padding: 0 20px 0 24px;
    background-color: var(--hf-button-color, #1E40AF);
    color: white;
    border: none;
    border-radius: 28px 0 0 28px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.hf-trigger-button:hover {
    background-color: var(--hf-button-hover, #1E3A8A);
}

.hf-trigger-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Backdrop */
.hf-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.hf-backdrop.active {
    display: block;
}

/* Slideout Panel */
.hf-slideout {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 100%;
    max-width: 400px;
    background-color: white;
    box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hf-slideout.active {
    transform: translateX(0);
}

/* Header */
.hf-header {
    background-color: #1E40AF;
    color: white;
    padding: 24px;
}

.hf-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

/* Unique ID to prevent theme conflicts */
#hf-panel-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.2;
    color: #ffffff !important;
}

.hf-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.hf-close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.hf-close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.hf-close-button svg {
    width: 24px;
    height: 24px;
}

/* Payment Display */
.hf-payment-display {
    text-align: center;
    padding: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.hf-payment-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.hf-payment-amount {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.hf-payment-amount span {
    font-size: 20px;
}

/* Unique ID to prevent theme conflicts on price display */
#hf-monthly-payment {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
}

.hf-payment-term {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

/* Form Content */
.hf-content {
    padding: 24px;
    flex: 1;
}

.hf-form-group {
    margin-bottom: 16px;
}

.hf-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

.hf-form-input {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.hf-form-input:focus {
    outline: none;
    border-color: #1E40AF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.hf-form-input.error {
    border-color: #EF4444;
}

.hf-error-message {
    color: #EF4444;
    font-size: 12px;
    margin-top: 4px;
}

/* Grid layout for name fields */
.hf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Slider */
.hf-slider-container {
    margin-bottom: 24px;
}

.hf-slider-value {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #1E40AF;
    margin-bottom: 12px;
}

.hf-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #1E40AF 0%, #1E40AF var(--slider-percentage), #E5E7EB var(--slider-percentage), #E5E7EB 100%);
    outline: none;
    -webkit-appearance: none;
}

.hf-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1E40AF;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hf-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1E40AF;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hf-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6B7280;
    margin-top: 8px;
}

/* Payment Options */
.hf-payment-options {
    margin-bottom: 24px;
}

.hf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hf-radio-label {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.hf-radio-label:hover {
    border-color: #1E40AF;
    background-color: #F9FAFB;
}

.hf-radio-label input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.hf-radio-label input[type="radio"]:checked + .hf-radio-text {
    color: #1E40AF;
}

.hf-radio-label:has(input[type="radio"]:checked) {
    border-color: #1E40AF;
    background-color: #EFF6FF;
}

.hf-radio-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hf-radio-text strong {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
}

.hf-radio-text small {
    font-size: 12px;
    color: #6B7280;
    line-height: 1.4;
}

/* Section divider */
.hf-section-divider {
    border-top: 1px solid #E5E7EB;
    margin: 24px 0;
    padding-top: 24px;
}

.hf-section-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Submit button */
.hf-submit-button {
    width: 100%;
    height: 48px;
    background-color: #1E40AF;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 24px 0 16px;
}

.hf-submit-button:hover:not(:disabled) {
    background-color: #1E3A8A;
}

.hf-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Disclaimer */
.hf-disclaimer {
    font-size: 12px;
    color: #6B7280;
    text-align: center;
    line-height: 1.5;
}

/* Success state */
.hf-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.hf-success.active {
    display: flex;
}

.hf-success svg {
    width: 64px;
    height: 64px;
    color: #10B981;
    margin-bottom: 16px;
}

.hf-success h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.hf-success p {
    color: #6B7280;
    margin-bottom: 16px;
}

.hf-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #E5E7EB;
    border-top-color: #1E40AF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .hf-slideout {
        max-width: 100%;
    }
    
    .hf-trigger-button {
        height: 48px;
        padding: 0 16px 0 20px;
        border-radius: 24px 0 0 24px;
    }
    
    .hf-trigger-text {
        font-size: 12px;
        letter-spacing: 0.3px;
    }
}
