/**
 * PBC Home Goal Savings Calculator Styles
 *
 * Brand Colors:
 * - Primary Red: #F5393B
 * - Hover Red: #d42f31
 * - Light Gray: #F6F6F6
 * - Border Gray: #E5E5E5
 * - Dark: #000000
 * - White: #FFFFFF
 */

/* CSS Custom Properties (can be overridden via inline styles) */
.pbc-home-goal-calculator {
    --pbc-primary: #F5393B;
    --pbc-primary-hover: #d42f31;
    --pbc-gray: #F6F6F6;
    --pbc-border: #E5E5E5;
    --pbc-dark: #000000;
    --pbc-white: #FFFFFF;
    --pbc-text: #333333;
    --pbc-text-light: #666666;
    --pbc-success: #10B981;
    --pbc-warning: #F59E0B;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    background: var(--pbc-white);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Form Section */
.pbc-hgc-form {
    padding: 32px;
}

.pbc-hgc-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--pbc-dark);
    margin: 0 0 8px 0;
    text-align: center;
}

.pbc-hgc-subtitle {
    font-size: 14px;
    color: var(--pbc-text-light);
    margin: 0 0 32px 0;
    text-align: center;
}

/* Field Styles */
.pbc-hgc-field {
    margin-bottom: 24px;
}

.pbc-hgc-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pbc-dark);
    margin-bottom: 8px;
}

.pbc-hgc-optional {
    font-weight: 400;
    color: var(--pbc-text-light);
    font-size: 12px;
}

.pbc-hgc-field-hint {
    font-size: 12px;
    color: var(--pbc-text-light);
    margin: 8px 0 0 0;
}

/* Input Row */
.pbc-hgc-input-row {
    display: flex;
    align-items: center;
    background: var(--pbc-gray);
    border: 1px solid var(--pbc-border);
    border-radius: 8px;
    padding: 0 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pbc-hgc-input-row:focus-within {
    border-color: var(--pbc-primary);
    box-shadow: 0 0 0 3px rgba(245, 57, 59, 0.1);
}

.pbc-hgc-currency,
.pbc-hgc-percent {
    font-size: 16px;
    font-weight: 600;
    color: var(--pbc-text-light);
}

.pbc-hgc-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--pbc-dark);
    padding: 14px 8px;
    outline: none;
    font-family: inherit;
}

.pbc-hgc-input::-webkit-outer-spin-button,
.pbc-hgc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pbc-hgc-input[type=number] {
    -moz-appearance: textfield;
}

/* Slider Styles */
.pbc-hgc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--pbc-border);
    border-radius: 3px;
    outline: none;
    margin: 12px 0 8px 0;
    cursor: pointer;
}

.pbc-hgc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--pbc-primary);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--pbc-white);
    box-shadow: 0 2px 6px rgba(245, 57, 59, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.pbc-hgc-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(245, 57, 59, 0.4);
}

.pbc-hgc-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--pbc-primary);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--pbc-white);
    box-shadow: 0 2px 6px rgba(245, 57, 59, 0.3);
}

.pbc-hgc-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--pbc-text-light);
}

.pbc-hgc-calculated-value {
    font-size: 13px;
    color: var(--pbc-text-light);
    margin-top: 8px;
}

.pbc-hgc-calculated-value strong {
    color: var(--pbc-dark);
    font-weight: 600;
}

/* Select Styles */
.pbc-hgc-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--pbc-dark);
    background: var(--pbc-gray);
    border: 1px solid var(--pbc-border);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
}

.pbc-hgc-select:focus {
    outline: none;
    border-color: var(--pbc-primary);
    box-shadow: 0 0 0 3px rgba(245, 57, 59, 0.1);
}

/* Calculate Button */
.pbc-hgc-calculate-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--pbc-white);
    background: linear-gradient(135deg, var(--pbc-primary) 0%, var(--pbc-primary-hover) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 16px;
}

.pbc-hgc-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 57, 59, 0.35);
}

.pbc-hgc-calculate-btn:active {
    transform: translateY(0);
}

/* Results Section */
.pbc-hgc-results {
    padding: 0 32px 32px;
}

/* Primary Result */
.pbc-hgc-primary-result {
    background: linear-gradient(135deg, var(--pbc-primary) 0%, var(--pbc-primary-hover) 100%);
    color: var(--pbc-white);
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
}

.pbc-hgc-primary-result-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pbc-hgc-primary-result-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
}

.pbc-hgc-primary-result-sublabel {
    font-size: 14px;
    opacity: 0.8;
}

/* Breakdown Section */
.pbc-hgc-breakdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 24px;
    background: var(--pbc-gray);
    border-radius: 12px;
    margin-bottom: 24px;
}

.pbc-hgc-breakdown-item {
    text-align: center;
}

.pbc-hgc-breakdown-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--pbc-dark);
    margin-bottom: 4px;
}

.pbc-hgc-breakdown-label {
    font-size: 13px;
    color: var(--pbc-text-light);
}

.pbc-hgc-breakdown-divider {
    width: 1px;
    height: 40px;
    background: var(--pbc-border);
}

/* Progress Section */
.pbc-hgc-progress-section {
    text-align: center;
    margin-bottom: 24px;
}

.pbc-hgc-progress-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--pbc-dark);
    margin: 0 0 16px 0;
}

.pbc-hgc-donut-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.pbc-hgc-donut {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pbc-hgc-donut-bg {
    stroke: var(--pbc-border);
}

.pbc-hgc-donut-progress {
    transition: stroke-dasharray 0.8s ease-out;
}

.pbc-hgc-donut-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 700;
    color: var(--pbc-dark);
}

.pbc-hgc-progress-label {
    font-size: 13px;
    color: var(--pbc-text-light);
    margin: 12px 0 0 0;
}

/* Summary Cards */
.pbc-hgc-summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.pbc-hgc-card {
    background: var(--pbc-gray);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.pbc-hgc-card-timeline {
    grid-column: span 2;
}

.pbc-hgc-card-label {
    display: block;
    font-size: 12px;
    color: var(--pbc-text-light);
    margin-bottom: 4px;
}

.pbc-hgc-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--pbc-dark);
}

/* Status Message */
.pbc-hgc-status {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.pbc-hgc-status.pbc-hgc-status-success {
    background: rgba(16, 185, 129, 0.1);
}

.pbc-hgc-status.pbc-hgc-status-warning {
    background: rgba(245, 158, 11, 0.1);
}

.pbc-hgc-status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pbc-hgc-status-success .pbc-hgc-status-icon {
    background: var(--pbc-success);
}

.pbc-hgc-status-warning .pbc-hgc-status-icon {
    background: var(--pbc-warning);
}

.pbc-hgc-status-icon::after {
    content: '';
    display: block;
}

.pbc-hgc-status-success .pbc-hgc-status-icon::after {
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.pbc-hgc-status-warning .pbc-hgc-status-icon::after {
    content: '!';
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.pbc-hgc-status-message {
    font-size: 14px;
    color: var(--pbc-text);
    line-height: 1.5;
}

.pbc-hgc-status-message strong {
    font-weight: 600;
}

/* Reminder Options */
.pbc-hgc-reminders {
    background: var(--pbc-gray);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.pbc-hgc-reminders h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--pbc-dark);
    margin: 0 0 4px 0;
}

.pbc-hgc-reminders-desc {
    font-size: 13px;
    color: var(--pbc-text-light);
    margin: 0 0 16px 0;
}

.pbc-hgc-reminder-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pbc-hgc-reminder-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.pbc-hgc-reminder-option input {
    display: none;
}

.pbc-hgc-reminder-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--pbc-border);
    border-radius: 50%;
    position: relative;
    transition: border-color 0.2s;
}

.pbc-hgc-reminder-option input:checked + .pbc-hgc-reminder-radio {
    border-color: var(--pbc-primary);
}

.pbc-hgc-reminder-option input:checked + .pbc-hgc-reminder-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--pbc-primary);
    border-radius: 50%;
}

.pbc-hgc-reminder-text {
    font-size: 14px;
    color: var(--pbc-text);
}

.pbc-hgc-email-field {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

.pbc-hgc-email-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--pbc-border);
    border-radius: 8px;
    font-family: inherit;
    background: var(--pbc-white);
}

.pbc-hgc-email-input:focus {
    outline: none;
    border-color: var(--pbc-primary);
}

.pbc-hgc-set-reminder-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pbc-white);
    background: var(--pbc-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.pbc-hgc-set-reminder-btn:hover {
    background: var(--pbc-primary-hover);
}

/* CTA Button */
.pbc-hgc-cta-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--pbc-white);
    background: linear-gradient(135deg, var(--pbc-primary) 0%, var(--pbc-primary-hover) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-bottom: 12px;
}

.pbc-hgc-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 57, 59, 0.35);
    color: var(--pbc-white);
    text-decoration: none;
}

/* Recalculate Button */
.pbc-hgc-recalculate-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pbc-text);
    background: transparent;
    border: 1px solid var(--pbc-border);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, background-color 0.2s;
}

.pbc-hgc-recalculate-btn:hover {
    border-color: var(--pbc-text-light);
    background: var(--pbc-gray);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .pbc-hgc-form,
    .pbc-hgc-results {
        padding: 24px;
    }

    .pbc-hgc-title {
        font-size: 20px;
    }

    .pbc-hgc-primary-result {
        padding: 24px;
    }

    .pbc-hgc-primary-result-value {
        font-size: 40px;
    }

    .pbc-hgc-breakdown {
        gap: 20px;
        padding: 20px;
    }

    .pbc-hgc-breakdown-value {
        font-size: 20px;
    }

    .pbc-hgc-donut-container {
        width: 120px;
        height: 120px;
    }

    .pbc-hgc-donut-text {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .pbc-home-goal-calculator {
        border-radius: 12px;
    }

    .pbc-hgc-form,
    .pbc-hgc-results {
        padding: 20px;
    }

    .pbc-hgc-title {
        font-size: 18px;
    }

    .pbc-hgc-primary-result-value {
        font-size: 36px;
    }

    .pbc-hgc-breakdown {
        flex-direction: column;
        gap: 16px;
    }

    .pbc-hgc-breakdown-divider {
        width: 60px;
        height: 1px;
    }

    .pbc-hgc-summary-cards {
        grid-template-columns: 1fr;
    }

    .pbc-hgc-card-timeline {
        grid-column: span 1;
    }

    .pbc-hgc-email-field {
        flex-direction: column;
    }

    .pbc-hgc-set-reminder-btn {
        width: 100%;
    }
}
