/* Define a CSS variable for input height */
:root {
    --input-height: 44px; /* Increased height for better usability */
    --input-font-size: 16px; /* Set the default font size */
    --button-font-size: 18px; /* Font size for buttons */
}

/* Container for the entire form */
.form-container {
    width: 95%;
    max-width: 600px;
    margin: 20px auto; /* Add some top and bottom margin */
    padding: 20px; /* Add padding around the form */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    border-radius: 6px; /* Slightly larger border radius */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.07); /* Subtle shadow for better visibility */
}

/* Error message styling */
.error-message {
    color: red;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, height 0.3s ease-in-out;
    height: 0;
    overflow: hidden;
    text-align: center;
    font-size: 14px; /* Increased font size */
    margin-top: 5px;
}

/* Show error messages when they have content */
.error-message.show {
    opacity: 1;
    height: auto;
}

/* Loader styling */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 15px;
}

/* Animation for loader icon */
.loader svg {
    animation: rotate 1s linear infinite;
}

/* Keyframe animation for rotating loader */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* General styling for form groups (input fields, selects, buttons) */
.form-group {
    margin-bottom: 1.5rem; /* Increased bottom margin for better spacing */
    width: 100%;
}

/* Styling for all form inputs, selects, textareas, and buttons */
.form-group input,
.form-group select,
.form-group textarea,
.form-group button {
    font-size: var(--input-font-size); /* Use the font size variable */
    padding: 0.75rem; /* Increased padding for better touch targets */
    border: 1px solid #ccc;
    border-radius: 6px; /* Slightly larger border radius */
    width: 100%;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif; /* Apply the font */
    height: var(--input-height); /* Use the CSS variable */
    margin-top: 5px; /* Add top margin */
}

/* Focused state for form inputs, selects, textareas, and buttons */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-group button:focus {
    border-color: #9bd024;
    outline: none;
}

/* Styling for submit button */
.form-group button {
    background-color: #4caf50;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
    font-weight: 600;
    font-size: var(--button-font-size); /* Use the button font size variable */
    height: var(--input-height); /* Use the CSS variable */
    display: flex;
    align-items: center;
    justify-content: center; /* Flexbox to center the text vertically and horizontally */
    padding: 0; /* Remove any padding to avoid issues with centering */
}

/* Hover state for submit button */
.form-group button:hover:not(:disabled) {
    background-color: #45a049;
}

/* Disabled state for submit button */
.form-group button:disabled {
    background-color: #ccc;
}

/* Container for the phone number input and prefix */
.phone-input-container {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 6px; /* Slightly larger border radius */
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1.5rem; /* Increased bottom margin for better spacing */
    height: var(--input-height); /* Use the CSS variable */
}

/* Styling for phone prefix */
.phone-input-container span#phone-prefix {
    background-color: #f0f0f0;
    padding: 0.75rem; /* Increased padding for better touch targets */
    border-right: 1px solid #ccc;
    font-size: var(--input-font-size); /* Use the font size variable */
    font-family: 'Tajawal', sans-serif;
    color: dimgrey;
    height: 100%; /* Match height with container */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Styling for the phone number input */
.phone-input-container input {
    border: none;
    flex: 1;
    padding: 0.75rem; /* Increased padding for better touch targets */
    direction: rtl;
    box-sizing: border-box;
    text-align: right;
    font-size: var(--input-font-size); /* Use the font size variable */
    font-family: 'Tajawal', sans-serif;
    color: dimgrey;
    height: 100%; /* Match height with container */
}

/* Focused state for phone number input */
.phone-input-container input:focus {
    border-color: transparent;
    outline: none;
}

.phone-group .phone-input-container {
    display: flex;
    direction: ltr;
}

/* Styling for the form title */
.form-title {
    text-align: center;
    margin-bottom: 1.5rem; /* Increased bottom margin for better spacing */
    font-size: 1.8rem;
    color: #333;
    width: 100%;
}

/* Flexbox layout for the terms and conditions container */
.terms-and-conditions-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    font-size: 1rem; /* Increased font size for better readability */
    color: #333;
    text-align: center;
    width: 100%;
}

/* Container for the checkbox in the terms and conditions */
.terms-checkbox-container {
    display: inline-flex;
    margin-right: 0.75rem; /* Increased spacing for easier interaction */
}

/* Container for the terms and conditions text */
.terms-text-container {
    display: inline-flex;
    flex: 1;
}

/* Styling for the label in terms and conditions */
.terms-and-conditions label {
    line-height: 1.4; /* Increased line height for better readability */
}

/* Link styling within the terms and conditions */
.terms-and-conditions a {
    color: dimgray;
    text-decoration: none;
}

/* Hover state for links in the terms and conditions */
.terms-and-conditions a:hover {
    text-decoration: underline;
}

/* Container for the payment logos */
.payment-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px; /* Increased top margin */
}

/* Individual payment logos */
.payment-logos-container .payment-logo {
    height: 40px;
    margin: 0 10px; /* Increased margin between logos */
    object-fit: contain;
}

.payment-logos-container .payment-logo svg {
    height: 100%;  /* Make sure SVG scales to the container height */
    width: auto;   /* Maintain aspect ratio */
    vertical-align: middle;
}

/* Style for placeholder text */
::placeholder {
    color: dimgrey;
    font-size: var(--input-font-size); /* Use the font size variable */
    font-family: 'Tajawal', sans-serif;
    opacity: 1;
}

/* Style for placeholder text in right-to-left fields */
input[type="text"]::placeholder,
input[type="email"]::placeholder {
    text-align: right;
}

@media (max-width: 768px) {
    :root {
        --input-height: 40px; /* Adjust height for smaller screens */
        --input-font-size: 14px; /* Adjust font size for smaller screens */
        --button-font-size: 16px; /* Adjust button font size for smaller screens */
    }
}