/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Background */
body {
    background-color: #ffffff; /* Full background color */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: auto;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-size: contain; /* Makes the image larger */
    opacity: 1; /* Adjust transparency (0 = fully transparent, 1 = fully visible) */
    z-index: 0;
}

body * {
    position: relative;
    z-index: 1;
}


/* Centering Form */
.container {
    position: relative;
    max-width: 850px;
    width: 95%;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    animation: fadeIn 0.6s ease-in-out;
    overflow: hidden;
    flex-direction: column;
    border: 3px solid #3e8e41;
}

/* Form Heading */
h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
}

/* Form Layout */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Labels */
label {
    font-weight: 500;
    color: #444;
    font-size: 14px;
    display: block;
    margin-bottom: 3px;
}

/* Input Fields */
input, select, textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    height: 32px;
    transition: 0.3s ease-in-out;
}

input:focus, select:focus, textarea:focus {
    border-color: #6a93ff;
    box-shadow: 0 0 5px rgba(106, 147, 255, 0.5);
    outline: none;
}

select {
    height: 34px; /* Ensures dropdown fits well */
}

/* Textarea */
textarea {
    resize: none;
    height: 80px;
}
input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    height: 32px; /* Makes input shorter */
}
/* Row for Age and Sex */
.input-row {
    display: flex;
    gap: 5px;
}
.address-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start; /* Align inputs from left to right */
}
.input-group {
    flex: 1; /* Makes both inputs equal width */
    min-width: 200px; /* Ensures fields don’t get too small */
}
select, input {
    width: 100%;
}

.input-group-reason {
    margin-top: 10px;
}

/* Back Button Styling */
.back-btn {
    position: absolute;
    top: 10px;
    left: 20px;
    z-index: 1; /* Ensure it stays on top of other elements */
}

.back-btn button {
    background: #4CAF50;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
}

button i {
    margin-right: 5px; /* Spacing between icon and text */
}

.back-btn button:hover {
    background: #3e8e41;
    transform: scale(1.05);
}

/* Next Button */
button {
    width: 100%;
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s ease-in-out;
    
}

button:hover {
    background: #388e3c;
}

/* Fade-in Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .container {
        width: 90%;
        padding: 10px;
    }

    .input-row {
        flex-direction: column;
        gap: 15px;
    }
    .form-container {
        grid-template-columns: 1fr; /* Stack fields for smaller screens */
    }
    button {
        padding: 10px;
        font-size: 14px;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        width: 90%;
    }

    .input-row {
        flex-direction: column;
        gap: 15px;
    }
}

/* Ensure Back Button is properly aligned on mobile */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        width: 95%;
        padding: 15px;
    }

    .back-btn {
        top: 10px;
        left: 10px;
    }

    .back-btn button {
        font-size: 14px;
        padding: 8px 12px;
    }

    button {
        padding: 12px;
        font-size: 14px;
    }
}


.flash-messages {
    margin-bottom: 10px;
    padding: 5px;
    font-size: 0.9rem;
    max-width: 900px; /* Adjust based on your desired width */
    box-sizing: border-box;
}

.alert {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 5px;
    font-weight: 400;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    white-space: nowrap;  /* Prevents text from wrapping */
    overflow: hidden;     /* Ensures it stays on one line */
    text-overflow: ellipsis;  /* Adds "..." if the text overflows */
    margin-left: 0;      /* Align to the left */
    margin-right: 0;     /* Remove center alignment */
}

.alert.warning {
    background-color: #ffcccb; /* Light red color for warning */
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.danger {
    background-color: #f44336; /* Red color for danger */
    color: white;
    border: 1px solid #f5c6cb;
}

.alert:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.alert-icon {
    margin-right: 8px;
    font-size: 1.2rem;  /* Slightly larger icon */
}
