/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ========== GLOBAL STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #efefef;
    min-height: 100vh;
    padding: 20px;
    padding-top: 90px;
}

/* ========== CONTAINER ========== */
.calc-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* ========== HEADER ========== */
.header {
    background: #fd8045;
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ========== FORM CONTAINER ========== */
.form-container {
    padding: 40px;
}

/* ========== STEP SYSTEM ========== */
.step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step.active {
    display: block;
}

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

.step-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.step-number {
    background: #ff7b39;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.step-title {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 0;
}

/* ========== UNSELECT ALL BUTTON ========== */
.btn-unselect-all {
    position: absolute;
    top: 0;
    right: 0;
    background: #9ca3af;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-unselect-all.has-selections {
    background: #f87171;
}

.btn-unselect-all.has-selections:hover {
    background: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-unselect-all i {
    font-size: 0.8rem;
}

/* ========== CHOICE CARDS (STEP 1) ========== */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.choice-card {
    background: white;
    border: 3px solid #e5e7eb;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-card:hover {
    border-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.1);
}

.choice-card.selected {
    border-color: #27ae60;
    background: #f0f9f0;
    color: #2c5530;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.15);
}

.choice-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #ff7b39;
}

.choice-card.selected i {
    color: #27ae60;
}

.choice-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

/* ========== COMPONENT CARDS (STEP 2) ========== */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.component-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.component-card:hover {
    border-color: #27ae60;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.1);
    transform: translateY(-1px);
}

.component-card.selected {
    border-color: #27ae60 !important;
    background: #f0f9f0 !important;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.15) !important;
}

.component-card.auto-selected {
    border-color: #27ae60 !important;
    background: #f0f9f0 !important;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.15) !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.component-card.auto-selected .auto-label {
    display: inline-block !important;
    pointer-events: all !important;
}

.component-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.component-checkbox input {
    margin-top: 3px;
    transform: scale(1.2);
}

.component-info h4 {
    margin-bottom: 8px;
    color: #374151;
}

.component-info p {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
}

.auto-label {
    background: #f9d71c;
    color: #8b6914;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
    display: none;
    position: relative;
    cursor: default;
}

.auto-label::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    font-size: 0.72rem;
    font-weight: 400;
    padding: 7px 10px;
    border-radius: 7px;
    white-space: normal;
    width: 220px;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.auto-label::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.auto-label:hover::after,
.auto-label:hover::before {
    opacity: 1;
}

/* ========== FORM ELEMENTS (STEP 3) ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: #27ae60;
}

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

.form-group.optional label::after {
    content: " (optional)";
    color: #6b7280;
    font-weight: 400;
    font-size: 0.9rem;
}

/* ========== DATE RANGE PICKER ========== */
.date-range-field {
    position: relative;
}

.date-range-input {
    cursor: pointer;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.date-range-input:hover {
    border-color: #ff7b39;
}

.date-range-input.active {
    border-color: #ff7b39;
    box-shadow: 0 0 0 3px rgba(255, 123, 57, 0.1);
}

.date-range-text {
    color: #6b7280;
}

.date-range-text.selected {
    color: #374151;
}

/* ========== CALENDAR POPUP ========== */
.calendar-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.calendar-popup.show {
    display: flex;
    animation: overlayFadeIn 0.3s ease;
}

.calendar-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 30px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.calendar-nav {
    background: #f8fafc;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #374151;
    font-size: 1rem;
}

.calendar-nav:hover {
    background: #e5e7eb;
    transform: scale(1.1);
}

.calendar-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    flex: 1;
    margin: 0 15px;
}

.calendar-wrapper {
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.calendar-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.calendar-day-header {
    text-align: center;
    padding: 12px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-row {
    height: 45px;
}

.calendar-day {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    border: 1px solid transparent;
    margin: 2px;
}

.calendar-day:hover:not(.disabled) {
    background: #fff3ed;
    transform: scale(1.05);
}

.calendar-day.disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.calendar-day.disabled:hover {
    background: transparent;
    transform: none;
}

.calendar-day.selected,
.calendar-day.start-date,
.calendar-day.end-date {
    background: #ff7b39;
    color: white;
    font-weight: 600;
}

.calendar-day.in-range {
    background: rgba(255, 123, 57, 0.15);
    color: #ff7b39;
    font-weight: 500;
}

.calendar-day.start-date:not(.end-date) {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.calendar-day.end-date:not(.start-date) {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.calendar-day.start-date.end-date {
    border-radius: 8px;
}

.calendar-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
}

.selected-range {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
    flex: 1;
}

.calendar-buttons {
    display: flex;
    gap: 12px;
}

/* ========== BUTTONS ========== */
.btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #f8fafc;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-cancel:hover {
    background: #f1f5f9;
    border-color: #d1d5db;
}

.btn-apply {
    background: #ff7b39;
    color: white;
}

.btn-apply:hover:not(:disabled) {
    background: #e6692e;
    transform: translateY(-1px);
}

.btn-apply:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.date-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #ff7b39;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 123, 57, 0.3);
    background: #e6692e;
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* ========== SUMMARY SECTION ========== */
.summary-section {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.summary-block {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.summary-section h3 {
    color: #374151;
    margin-bottom: 15px;
}

.summary-info {
    display: block;
    margin-bottom: 20px;
}

.summary-info-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #27ae60;
    margin-bottom: 15px;
}

.summary-info-item strong {
    display: block;
    color: #374151;
    margin-bottom: 5px;
}

.summary-info-item span {
    color: #6b7280;
}

/* ========== THANK YOU MESSAGE ========== */
.thank-you {
    text-align: center;
    padding: 40px;
    color: #374151;
}

.thank-you i {
    font-size: 4rem;
    color: #27ae60;
    margin-bottom: 20px;
}

.thank-you h2 {
    margin-bottom: 15px;
    color: #374151;
}

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none;
}

/* ========== RESPONSIVE DESIGN ========== */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .calc-container {
        box-shadow: none;
        max-width: 100%;
    }
    
    .button-group {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .date-fields {
        grid-template-columns: 1fr;
    }
    
    .calendar-popup {
        padding: 10px;
    }
    
    .calendar-container {
        max-width: 100%;
        padding: 20px;
    }
    
    .choice-grid {
        grid-template-columns: 1fr;
    }
    
    .component-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* ========== MOBILE: THANK YOU PAGE / SUMMARY (added) ========== */
@media (max-width: 768px) {
    body {
        padding: 8px;
        padding-top: 80px;
    }

    .form-container {
        padding: 20px 12px;
    }

    .thank-you {
        padding: 20px 0;
    }

    .thank-you h2 {
        font-size: 1.5rem;
    }

    .summary-section {
        padding: 15px 12px;
    }

    .summary-info-item {
        padding: 12px;
    }

    /* Component summary table: inline-styled cells need !important */
    .summary-section table th,
    .summary-section table td {
        padding: 10px 8px !important;
        font-size: 0.85rem !important;
    }

    .header {
        padding: 25px 15px;
    }

    .header h1 {
        font-size: 1.7rem;
    }

    .header p {
        font-size: 0.95rem;
    }
}