:root {
            --primary-color: #0056b3;
            --secondary-color: #28a745;
            --error-color: #dc3545;
            --bg-color: #f4f6f9;
            --accent-color: #ff5733;
        }

        body {
            font-family: 'Roboto', sans-serif;
            background: var(--bg-color);
            margin: 0;
            padding: 20px;
        }

        /* --- HEADER --- */
        header {
            margin-bottom: 20px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            position: sticky;
            top: 0;
            background-color: white;
            z-index: 100;
            height: 35px;
        }

        .head-container {
            align-items: center;
            text-decoration: none;
            margin-top: 5px;
            margin-bottom: 5px;
            background-color: rgb(0, 0, 73);
            padding-bottom: 2px;
            display: flex;
            justify-content: flex-start; /* Fixed 'justify' typo */
            width: 100%;
            position: sticky;
        }

        .portal-title {
            font-family: 'Fredoka One', cursive;
            font-size: 0.8rem;
            color: white;
            margin-left: 10px;  
        }

        .logo-image {
            height: 20px;
            width: auto;
            border: 2px solid white;
            padding: 3px;
            border-radius: 0px;
            background-color: white;
            margin-left: 5px;
        }

        /* --- HERO SECTION --- */
        .hero {
            background: linear-gradient(rgba(0, 119, 182, 0.7), rgba(0, 119, 182, 0.7)), url('https://www.thegaudium.com/wp-content/uploads/2016/08/Pooja0002.jpg') no-repeat center center/cover;
            height: 90vh;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            color: #fff;
            max-width: 100%;
            border-radius: 8px; /* Added nice touch */
            margin-bottom: 20px;
        }

        .hero-content h1 {
            font-size: 3.5rem;
            color: #fff;
            margin: 1rem;
        }

        .hero-content p {
            font-size: 1.2rem;
            margin-bottom: 1rem;
        }

        .btn-primary {
            display: inline-block;
            background: var(--accent-color);
            color: #fff;
            border-radius: 20px;
            padding: 12px 28px;
            text-decoration: none;
            font-weight: 700;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }

        /* --- CONTAINER & CARD --- */
        .container {
            max-width: 100%;
            margin: 0 auto;
            background: white;
            border-radius: 12px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.1);
            overflow: hidden;
            position: relative;
        }

        /* --- PROGRESS BAR --- */
        .progress-container {
            background: #e9ecef;
            height: 8px;
            width: 100%;
        }
        .progress-bar {
            background: var(--primary-color);
            height: 100%;
            width: 0%;
            transition: width 0.4s ease-in-out;
        }
        .step-indicator {
            text-align: center;
            padding: 15px;
            font-weight: bold;
            color: #555;
            border-bottom: 1px solid #eee;
        }

        /* --- FORM STEPS --- */
        .form-step {
            display: none;
            padding: 25px;
            animation: fadeIn 0.5s;
        }
        .form-step.active {
            display: block;
        }

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

        /* --- INPUTS & LABELS --- */
        label {
            display: block;
            margin-top: 15px;
            font-weight: 500;
            color: #333;
        }
        .bengali {
            font-family: 'Tiro Bangla', serif;
            font-size: 0.9em;
            color: #666;
            display: block;
            margin-bottom: 5px;
        }
        input, select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 6px;
            font-size: 16px;
            box-sizing: border-box;
            transition: border 0.3s;
        }
        input:focus, select:focus {
            border-color: var(--primary-color);
            outline: none;
            box-shadow: 0 0 5px rgba(0,86,179,0.2);
        }
        input:invalid {
            border-left: 4px solid var(--error-color);
        }
        input:valid {
            border-left: 4px solid var(--secondary-color);
        }

        /* --- BUTTONS --- */
        .btn-group {
            display: flex;
            justify-content: space-between;
            margin-top: 30px;
        }
        button {
            padding: 12px 25px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            transition: 0.3s;
        }
        .btn-next, .btn-submit {
            background: var(--primary-color);
            color: white;
        }
        .btn-prev {
            background: #6c757d;
            color: white;
        }
        .btn-submit {
            background: var(--secondary-color);
        }
        
        button:disabled {
            background: #cccccc;
            cursor: not-allowed;
            opacity: 0.7;
        }
        button:hover:not(:disabled) {
            filter: brightness(1.1);
        }

        /* --- LOADING OVERLAY --- */
        #loadingOverlay {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(255,255,255,0.9);
            z-index: 9999;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }
        .spinner {
            border: 5px solid #f3f3f3;
            border-top: 5px solid var(--primary-color);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
        }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* =========================================
           PRINT STYLES - THIS FIXES THE 2-PAGE ISSUE
           ========================================= */
        #printLayout {
            display: none; /* Hidden on screen */
        }

        @media print {
            /* 1. Hide the website elements */
            header, main, .hero, .container, #loadingOverlay, .step-indicator, .progress-container {
                display: none !important;
            }
            
            body { 
                background: white; 
                padding: 0;
                margin: 0;
            }

            /* 2. Show the Receipt */
            #printLayout {
                display: block !important;
                width: 100%;
                font-family: 'Times New Roman', serif;
                position: absolute;
                top: 0;
                left: 0;
                padding: 0px;
            }

            .print-header {
                text-align: center;
                border-bottom: 2px solid black;
                margin-bottom: 20px;
            }
            .print-table {
                width: 100%;
                border-collapse: collapse;
                margin-bottom: 15px;
            }
            .print-table th, .print-table td {
                border: 1px solid black;
                padding: 8px;
                text-align: left;
            }
            .print-footer {
                margin-top: 50px;
                display: flex;
                justify-content: space-between;
            }
        }
        /* --- UPDATED VALIDATION STYLES --- */

/* Target BOTH input and select boxes for INVALID state (Red) */
input:invalid, select:invalid {
    border-left: 4px solid var(--error-color);
    box-shadow: none; /* Optional: removes default browser glow to make it clearer */
}

/* Target BOTH input and select boxes for VALID state (Green) */
input:valid, select:valid {
    border-left: 4px solid var(--secondary-color);
}
