/* --- Calculator Container --- */
.calculator-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* --- Calculator Header --- */
.calculator-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}
.calculator-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #7e0051, #a855f7, #3b82f6);
}

/* --- Description --- */
.calculator-description {
    font-size: 1.1rem;
    color: #64748b;
    line-height: 1.7;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.calculator-header .calculator-description {
    color: #475569;
}

/* --- Calculator Form --- */
.calculator-form {
    padding: 2.5rem;
    background: #fff;
}

/* --- Input Groups --- */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}
.input-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
    position: relative;
}
.input-group label::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #7e0051, #a855f7);
    transition: width 0.3s ease;
}
.input-group:focus-within label::after {
    width: 100%;
}
.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}
.input-group input:focus {
    outline: none;
    border-color: #7e0051;
    box-shadow: 0 0 0 3px rgba(126, 0, 81, 0.1);
    transform: translateY(-1px);
}
.input-group input:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.input-group input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.input-with-symbol {
    padding-right: 3rem !important;
}
.currency-symbol,
.percent-symbol {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    pointer-events: none;
}

/* --- Button --- */
.calculate-button {
    width: 100%;
    background: linear-gradient(135deg, #7e0051 0%, #a855f7 50%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(126, 0, 81, 0.3);
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}
.calculate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(126, 0, 81, 0.4);
}
.calculate-button:active {
    transform: translateY(0);
}
.calculate-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s;
}
.calculate-button:hover::before {
    left: 100%;
}
.calculate-button.loading {
    pointer-events: none;
    opacity: 0.8;
}
.calculate-button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- Result Container --- */
.result-container {
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-top: 1px solid #e5e7eb;
    margin-top: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
}
.result-container.visible {
    opacity: 1;
    max-height: 1000px;
}

/* --- Results --- */
.result-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: #7e0051;
    text-align: center;
    margin: 1rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}
.result-amount::after {
    content: "";
}
.result-description {
    text-align: center;
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}
.result-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.result-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease;
}
.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.result-item h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.result-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #374151;
    margin: 0;
}
.result-item .percentage {
    font-size: 0.875rem;
    color: #10b981;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* --- Progress Bar (Goal/Retirement) --- */
.goal-progress {
    text-align: center;
    margin-bottom: 2rem;
}
.goal-icon {
    font-size: 3rem;
    color: #7e0051;
    margin-bottom: 1rem;
    display: block;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin: 1.5rem 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7e0051, #a855f7);
    border-radius: 10px;
    transition: width 1s ease;
    position: relative;
}
.progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* --- Tips (Goal/Retirement) --- */
.goal-tips {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}
.goal-tips h4 {
    color: #0c4a6e;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}
.goal-tips ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #0c4a6e;
    font-size: 0.875rem;
}
.goal-tips li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* --- Disclaimer --- */
.disclaimer {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: #92400e;
    line-height: 1.6;
}
.disclaimer strong {
    color: #78350f;
}
.disclaimer p {
    margin: 0.5rem 0;
}
.disclaimer p:first-child {
    margin-top: 0;
}
.disclaimer p:last-child {
    margin-bottom: 0;
}

/* --- Form Grid --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* --- Error Message --- */
.input-group .error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}
.input-group input.error + .error-message {
    display: block;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .calculator-container {
        margin: 1rem;
        border-radius: 12px;
    }
    .calculator-form {
        padding: 1.5rem;
    }
    .calculator-header {
        padding: 1.5rem;
    }
    .result-amount {
        font-size: 2rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .result-breakdown {
        grid-template-columns: 1fr;
    }
}

/* --- Accessibility Focus --- */
.input-group input:focus-visible {
    box-shadow: 0 0 0 3px rgba(126, 0, 81, 0.2);
}
.calculate-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(126, 0, 81, 0.3);
}
