/* General Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.input-group {
    display: flex;
    align-items: center;
}
.input-prefix {
    padding: 8px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
}
.input-group input[type="tel"] {
    border-radius: 0 4px 4px 0;
    margin: 0;
}

body {
    font-family: 'Roboto', 'Amiri', sans-serif;
    background-color: #f0f2f5;
    color: #2d3748;
    line-height: 1.6;
    padding: 10px;
}

/* Container Styles */
.container {
    max-width: 950px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    padding: 20px;
    overflow: hidden;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.logo {
    max-width: 120px;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.8rem;
    color: #701a1a;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #701a1a;
    font-weight: 500;
}

.instruction {
    font-size: 0.95rem;
    color: #4a5568;
    font-style: italic;
    margin-top: 10px;
}

/* Form Styles */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    background-color: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.form-section h2 {
    font-size: 1.4rem;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

label {
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 4px;
}

.required::after {
    content: " *";
    color: #e53e3e;
}

input, select, textarea {
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #701a1a;
    box-shadow: 0 0 0 4px rgba(112, 26, 26, 0.15);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

select:disabled {
    background-color: #edf2f7;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Area Inputs */
.area-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Increased for better separation */
    gap: 20px; /* Increased gap for clearer separation */
    margin-top: 10px;
    align-items: center; /* Vertically align items */
}

.area-inputs .form-group {
    margin-bottom: 0; /* Remove bottom margin for nested groups */
    border: 1px solid #e2e8f0; /* Add subtle border for each field group */
    padding: 10px; /* Add internal padding */
    border-radius: 6px; /* Slight rounding */
    background-color: #ffffff; /* White background for contrast */
}

.area-inputs label {
    font-size: 0.95rem;
    color: #4a5568;
    margin-bottom: 4px;
    display: block; /* Ensure labels are block-level */
}

.area-inputs input {
    width: 100%; /* Ensure inputs fill their container */
    margin: 0; /* Remove default margins */
}

/* Submit Button */
.submit-btn {
    background-color: #701a1a;
    color: #ffffff;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    max-width: 250px;
    align-self: center;
    margin-top: 20px;
}

.submit-btn:hover {
    background-color: #5c1515;
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Error Messages */
.error {
    font-size: 0.85rem;
    color: #e53e3e;
    margin-top: 5px;
    display: none;
}

/* Responsive Design */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 25px;
        margin: 20px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .form-section h2 {
        font-size: 1.3rem;
    }

    .area-inputs {
        grid-template-columns: 1fr 1fr; /* Two columns on tablets */
    }

    .submit-btn {
        font-size: 1.1rem;
        padding: 12px 20px;
        max-width: 250px;
    }
}

@media (min-width: 769px) {
    .container {
        padding: 40px;
        margin: 40px auto;
    }

    h1 {
        font-size: 2rem;
    }

    .form-section h2 {
        font-size: 1.5rem;
    }

    .form-section {
        padding: 25px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    input, select, textarea {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .area-inputs {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Increased for desktop */
        gap: 25px; /* Increased gap for desktop */
    }

    .area-inputs .form-group {
        padding: 12px; /* Increased padding for desktop */
    }

    .area-inputs label {
        font-size: 1rem;
    }

    .submit-btn {
        font-size: 1.2rem;
        padding: 14px 24px;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
        margin: 10px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .form-section h2 {
        font-size: 1.2rem;
    }

    label {
        font-size: 0.95rem;
    }

    input, select, textarea {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .area-inputs {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 15px; /* Reduced gap for mobile */
    }

    .area-inputs .form-group {
        padding: 8px; /* Reduced padding for mobile */
    }

    .submit-btn {
        font-size: 1rem;
        padding: 10px 18px;
        max-width: 200px;
    }
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #2d3748;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: #701a1a;
    cursor: pointer;
}

.radio-label input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(112, 26, 26, 0.15);
}

/* Responsive adjustments for radio buttons */
@media (max-width: 480px) {
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-label {
        font-size: 0.9rem;
    }

    .radio-label input[type="radio"] {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 769px) {
    .radio-label {
        font-size: 1rem;
    }

    .radio-label input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}