/* ===== Reset & Base Styles ===== */
#cost-calculator-wrapper {
    position: relative;
    padding: 3rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #334155;
}

#cost-calculator-wrapper * {
    box-sizing: border-box;
}

/* ===== Background ===== */
.calc-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    background: linear-gradient(135deg, #dbeafe 0%, #ffffff 50%, #f3e8ff 100%);
}

.calc-bg-circle {
    position: absolute;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.calc-bg-circle-1 {
    top: 0;
    right: 0;
    background: rgba(96, 165, 250, 0.3);
}

.calc-bg-circle-2 {
    bottom: 0;
    left: 0;
    background: rgba(196, 181, 253, 0.3);
}

.calc-bg-circle-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(129, 140, 248, 0.2);
}

/* ===== Container ===== */
.calc-container {
    position: relative;
    z-index: 1;
    max-width: 1170px;
    margin: 0 auto;
}

/* ===== Header ===== */
.calc-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.calc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.calc-badge .calc-icon {
    width: 1rem;
    height: 1rem;
}

.calc-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 1rem 0;
    background: linear-gradient(to right, #2563eb, #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calc-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 42rem;
    margin: 0 auto;
}

/* ===== Progress Bar ===== */
.calc-progress-wrapper {
    max-width: 48rem;
    margin: 0 auto 3rem;
    padding: 1.5rem;
}

.calc-progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calc-step-item {
    display: flex;
    align-items: center;
    flex-direction: column;
    flex: 1;
}

.calc-step-item > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calc-step-circle {
    position: relative;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.calc-step-circle.active,
.calc-step-circle.completed {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.calc-step-circle.active {
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.2);
}

.calc-step-number {
    display: inline-block;
}

.calc-step-circle.completed .calc-step-number {
    display: none;
}

.calc-step-check {
    display: none;
    width: 1.5rem;
    height: 1.5rem;
}

.calc-step-circle.completed .calc-step-check {
    display: block;
}

.calc-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    white-space: nowrap;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.calc-step-label.active,
.calc-step-label.completed {
    color: #1d4ed8;
}

.calc-connector {
    height: 0.375rem;
    flex: 1;
    margin: 0 0.75rem 1.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.calc-connector.completed {
    background: linear-gradient(to right, #2563eb, #1e40af);
}

/* ===== Main Grid ===== */
.calc-main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 1024px) {
    .calc-main-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* ===== Form Card ===== */
.calc-form-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2.5rem;
    animation: fadeInUp 0.6s ease;
}

/* ===== Step Styles ===== */
.calc-step {
    animation: fadeIn 0.5s ease;
}

.calc-step-header {
    margin-bottom: 2rem;
}

.calc-step-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.calc-step-header p {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

/* ===== Options Grid ===== */
.calc-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calc-options-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.calc-option {
    position: relative;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: white !important;
    font-weight: 500;
    color: #475569 !important;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
}

.calc-option:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.calc-option.active {
    border-color: #2563eb;
    background: #eff6ff !important;
    color: #1e3a8a !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.calc-option.active::after {
    content: '';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    background: #2563eb;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 0.75rem;
    background-position: center;
    background-repeat: no-repeat;
}

/* Large Options with Icons */
.calc-option-large {
    min-height: 5rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calc-option-icon {
    width: 3rem;
    height: 3rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.calc-option-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: #64748b;
    transition: stroke 0.2s ease;
}

.calc-option-large.active .calc-option-icon {
    background: #2563eb;
}

.calc-option-large.active .calc-option-icon svg {
    stroke: white;
}

.calc-option-large span {
    font-size: 1.125rem;
    font-weight: 600;
    flex: 1;
}

/* Checkbox-style options for Step 3 */
.calc-option-checkbox {
    position: relative;
    padding-left: 2.5rem;
}

.calc-option-checkbox::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #cbd5e1;
    border-radius: 0.25rem;
    background: white;
    transition: all 0.2s ease;
}

.calc-option-checkbox.active::before {
    background: #2563eb;
    border-color: #2563eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 0.75rem;
    background-position: center;
    background-repeat: no-repeat;
}

.calc-option-checkbox.active::after {
    display: none;
}

/* Options List (for Step 4) */
.calc-options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calc-option-list {
    position: relative;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: white !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calc-option-list:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.calc-option-list.active {
    border-color: #2563eb;
    background: #eff6ff !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.calc-option-list.active::after {
    content: '';
    width: 1.5rem;
    height: 1.5rem;
    background: #2563eb !important;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-size: 0.875rem;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.calc-option-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b !important;
    margin-bottom: 0.25rem;
}

.calc-option-list.active .calc-option-title {
    color: #1e3a8a !important;
}

.calc-option-desc {
    font-size: 0.875rem;
    color: #64748b !important;
}

/* Other Input */
.calc-other-input {
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

.calc-other-input input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.calc-other-input input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Contact Form ===== */
.calc-form {
    margin-bottom: 1.5rem;
}

.calc-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .calc-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.calc-form-group {
    display: flex;
    flex-direction: column;
}

.calc-form-group-full {
    margin-bottom: 1.25rem;
}

.calc-form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.calc-form-group .required {
    color: #ef4444;
}

.calc-form-group input,
.calc-form-group select,
.calc-form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.calc-form-group input:focus,
.calc-form-group select:focus,
.calc-form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calc-form-group input.error,
.calc-form-group select.error,
.calc-form-group textarea.error {
    border-color: #ef4444;
}

.calc-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    min-height: 1.25rem;
}

/* ===== Navigation Buttons ===== */
.calc-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    gap: 1rem;
}

.calc-btn-prev,
.calc-btn-next,
.calc-btn-submit {
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.calc-btn-prev {
    background: white !important;
    color: #475569 !important;
    border: 2px solid #cbd5e1;
}

.calc-btn-prev:hover {
    background: #f8fafc !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.calc-btn-next,
.calc-btn-submit {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white !important;
    margin-left: auto;
}

.calc-btn-next:hover,
.calc-btn-submit:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.calc-btn-next:disabled,
.calc-btn-submit:disabled {
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.calc-btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* ===== Summary Sidebar ===== */
.calc-summary-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.calc-summary-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.calc-summary-empty {
    color: #94a3b8;
    font-size: 0.875rem;
    margin: 0;
}

.calc-summary-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calc-summary-item {
    border-left: 4px solid #2563eb;
    padding-left: 1rem;
    animation: fadeInLeft 0.5s ease;
}

.calc-summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.25rem 0;
}

.calc-summary-value {
    color: #1e293b;
    font-weight: 500;
    margin: 0;
}

.calc-summary-progress {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.calc-summary-progress .calc-icon {
    width: 1rem;
    height: 1rem;
    stroke: #10b981;
}


/* ===== Thank You Message ===== */
.calc-thank-you {
    max-width: 48rem;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 1rem;
    animation: fadeInUp 0.6s ease;
}

.calc-success-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-success-icon svg {
    width: 3rem;
    height: 3rem;
    stroke: #10b981;
}

.calc-thank-you h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.calc-thank-you > p {
    font-size: 1.125rem;
    color: #64748b;
    margin: 0 0 2rem 0;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.calc-summary-final {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 42rem;
    margin: 0 auto 2rem;
    text-align: left;
}

.calc-summary-final h3 {
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem 0;
}

.calc-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #e2e8f0;
}

.calc-summary-row:last-child {
    border-bottom: none;
}

.calc-summary-row span {
    color: #64748b;
}

.calc-summary-row strong {
    color: #1e293b;
    font-weight: 500;
}

.calc-confirmation-email {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 2rem;
}

.calc-confirmation-email strong {
    color: #1e293b;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.calc-spinner {
    animation: spin 1s linear infinite;
}

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .calc-title {
        font-size: 2.5rem;
    }

    .calc-subtitle {
        font-size: 1rem;
    }

    .calc-form-card {
        padding: 1.5rem;
    }

    .calc-step-header h2 {
        font-size: 1.5rem;
    }

    .calc-options-grid {
        grid-template-columns: 1fr;
    }

    .calc-options-grid-large {
        grid-template-columns: 1fr;
    }

    .calc-progress-bar {
        position: relative;
    }

    .calc-step-label {
        font-size: 0.625rem;
    }

    .calc-step-circle {
        width: 2.5rem;
        height: 2.5rem;
    }

    .calc-connector {
        margin: 0 0.5rem 1.5rem;
    }

    .calc-nav-buttons {
        flex-direction: column;
    }

    .calc-btn-prev,
    .calc-btn-next,
    .calc-btn-submit {
        width: 100%;
        justify-content: center;
    }

    .calc-btn-next,
    .calc-btn-submit {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    #cost-calculator-wrapper {
        padding: 1.5rem 0.5rem;
    }

    .calc-title {
        font-size: 2rem;
    }

    .calc-step-circle {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }

    .calc-step-check {
        width: 1rem;
        height: 1rem;
    }

    .calc-step-label {
        font-size: 0.5rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .calc-background,
    .calc-nav-buttons,
    .calc-footer {
        display: none;
    }

    #cost-calculator-wrapper {
        background: white;
    }
}
