/* --- General Body & Font Styles --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 0;
}

/* --- Main Form Container --- */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 20px;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 600;
}

/* --- Fieldset & Legend Styling --- */
fieldset {
    border: none;
    padding: 0;
    margin-bottom: 25px;
}

legend {
    font-size: 1.2em;
    font-weight: 600;
    color: #0056b3;
    padding-bottom: 10px;
    margin-bottom: 20px;
    width: 100%;
    border-bottom: 2px solid #e9ecef;
}

/* --- Labels --- */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

/* --- Input, Select Fields --- */
input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #f8f9fa;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* --- Radio & Checkbox Styling --- */
input[type="radio"],
input[type="checkbox"] {
    margin-right: 10px;
}

/* Make radio/checkbox labels more interactive */
fieldset > label {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    font-weight: 400;
}

/* --- File Input & Image Preview --- */
input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
}

#imagePreview {
    display: none;
    max-width: 200px;
    margin-top: 10px;
    border-radius: 8px;
    border: 2px dashed #ced4da;
    padding: 5px;
}

/* --- Submit Button --- */
button[type="submit"] {
    display: block;
    width: 100%;
    padding: 15px;
    background-image: linear-gradient(to right, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 20px;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }
    h1 {
        font-size: 1.8em;
    }
}

/* --- Tooltip Styles --- */
.label-with-tooltip {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between label and icon */
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    cursor: help;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 150%;
    left: 50%;
    margin-left: -110px; /* Use half of the width to center */
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9em;
    font-weight: 400;
}

/* Arrow for the tooltip */
.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}


/* --- REN No Checkbox Styles --- */
.input-with-checkbox {
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-with-checkbox input[type="text"] {
    flex-grow: 1; /* Input takes up available space */
    margin-bottom: 0; /* Remove margin from the input */
}

/* Style for the disabled input */
.input-with-checkbox input[type="text"]:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}


.checkbox-container {
    display: flex;
    align-items: center;
    white-space: nowrap; /* Prevent "No REN" from wrapping */
}

.checkbox-container input[type="checkbox"] {
    margin-right: 5px;
}

.checkbox-container label {
    margin-bottom: 0; /* Reset label margin */
    font-weight: 400;
    color: #555;
}


/* --- Success Page Styles --- */
.success-container {
    text-align: center;
    padding: 50px 40px;
}

.success-icon {
    font-size: 3rem;
    line-height: 100px; /* Vertically center the checkmark */
    color: #28a745;
    background-color: #eaf6ec;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 25px;
}

.success-container h1 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.success-container p {
    color: #555;
    font-size: 1.1em;
    max-width: 450px;
    margin: 0 auto 30px;
}

.order-id-box {
    background-color: #f8f9fa;
    border: 2px dashed #ced4da;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 35px;
}

.order-id-box span {
    font-size: 1.1em;
    color: #555;
    display: block;
    margin-bottom: 10px;
}

.order-id-display {
    font-size: 2.8em;
    font-weight: 700;
    color: #007bff;
    letter-spacing: 2px;
    font-family: 'Poppins', sans-serif;
}

.back-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

.back-button:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* --- Input Validation Styles --- */
.error-message {
    color: #d93025;
    font-size: 0.9em;
    display: none; /* Hidden by default */
    margin-top: -10px;
    margin-bottom: 15px;
}

/* Style for invalid input fields */
input.is-invalid {
    border-color: #d93025;
}

input.is-invalid:focus {
    border-color: #d93025;
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.15);
}

/* --- Error Page Icon --- */
.error-icon {
    font-size: 3rem;
    line-height: 100px;
    font-weight: bold;
    color: #d93025; /* Red */
    background-color: #fbe9e7; /* Light Red */
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 25px;
}

/* --- Progress Bar Styles --- */
#progress-wrapper {
    width: 100%;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    height: 30px;
    text-align: center;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #28a745;
    border-radius: 8px;
    transition: width 0.3s ease-in-out;
}

#progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 600;
}

