/* General styles */
body {
    font-family: 'Poppins', sans-serif;
    /* Keep important here if needed to override theme forcefully */
    background: #4644e4 !important;
    min-height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white; /* Removed !important, specificity should be enough */
}

/* Text elements */
h1, h2, h3, h4, h5, h6, p, span, div, a, li, label, .notification,
.form-label, .select-label, .idgen-result-class, .password-message {
    color: white; /* Removed !important */
}

/* Container adjustments */
.combined-form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 94%;
    max-width: 500px;
    margin: 20px auto;
    transition: all 0.3s ease;
}

/* Form styling */
.idgen-form-wrapper, .password-login-form {
    background: rgba(255, 255, 255, 0.6);
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    width: 100%;
    margin-bottom: 25px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

/* Form headings */
.password-login-form h2, .idgen-form-wrapper h2 {
    font-size: 1.6rem;
    color: #4644e4; /* Keep specific color for headings */
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form Labels */
.form-label, .select-label {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.95rem;
}

/* Input fields and selects */
.password-login-form input[type="password"], /* More specific */
.idgen-form-class input[type="text"], /* More specific */
.idgen-form-class select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #4644e4;
    border-radius: 12px;
    font-size: 1rem;
    color: #333; /* Input text color */
    background: rgba(255, 255, 255, 0.85); /* Slightly less transparent */
    margin-bottom: 18px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none; /* For consistent look */
    -moz-appearance: none;
    appearance: none;
}

/* Remove dropdown indicator from text/password inputs */
.idgen-form-class input[type="text"],
.password-login-form input[type="password"] {
    background-image: none;
}

/* Add dropdown indicator and adjust size for select elements */
.idgen-form-class select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px; /* Slightly larger arrow */
    padding-right: 45px; /* Ensure space for arrow */
    cursor: pointer;
     /* Ensure text fits vertically */
    height: auto; /* Let content determine height */
    min-height: 50px; /* Minimum height */
    line-height: initial; /* Reset line height */
}
/* Adjust select padding if needed for specific browsers */


/* Focus styles */
.password-login-form input:focus,
.idgen-form-class input:focus,
.idgen-form-class select:focus {
    outline: none;
    border-color: #2e86de;
    box-shadow: 0 0 8px rgba(46, 134, 222, 0.6);
    background-color: #fff; /* Make background solid on focus */
}

/* Side-by-side layout */
.department-course-container,
.name-father-container {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on very small screens if needed */
    gap: 18px;
    width: 100%;
    margin-bottom: 10px; /* Space below containers */
}

.department-course-container > div,
.name-father-container > div {
    flex: 1 1 calc(50% - 18px); /* Allow flex grow/shrink, adjust basis */
    min-width: 150px; /* Prevent fields from becoming too narrow */
}

/* Button enhancements */
.password-login-form button, .idgen-form-class button {
    background: linear-gradient(135deg, #4644e4, #2e2cbb); /* Slightly adjusted gradient */
    color: #fff;
    padding: 16px 30px; /* Slightly adjusted padding */
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(70, 68, 228, 0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: auto; /* Don't force full width unless needed */
    min-width: 150px;
    margin-top: 10px; /* Space above button */
    display: inline-block;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .combined-form-container {
        width: 100%;
        padding: 15px;
        margin: 10px 0;
     }
    .idgen-form-wrapper, .password-login-form {
        padding: 20px 15px; /* Adjust padding */
        border-radius: 15px;
     }
    .password-login-form h2, .idgen-form-wrapper h2 {
        font-size: 1.4rem;
    }
    /* Stack fields on small screens */
    .department-course-container > div,
    .name-father-container > div {
       flex-basis: 100%; /* Full width */
    }
    .password-login-form button, .idgen-form-class button {
        width: 100%; /* Full width button on small screens */
        padding: 15px;
    }
}

@media (min-width: 768px) {
    .combined-form-container {
        max-width: 600px;
    }
    .idgen-form-wrapper, .password-login-form {
        padding: 30px;
    }
    .password-login-form button, .idgen-form-class button {
        padding: 18px 35px;
        font-size: 1.15rem;
        width: auto; /* Auto width again */
    }
}

@media (min-width: 1024px) {
    .combined-form-container {
        max-width: 900px; /* Wider combined view */
        flex-direction: row; /* Side by side */
        gap: 30px;
        align-items: flex-start; /* Align tops */
    }
    .idgen-form-wrapper, .password-login-form {
        width: calc(50% - 15px); /* Equal width */
        margin-bottom: 0; /* Remove bottom margin when side-by-side */
    }
}

/* Animations & Messages */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-message, .error-message {
    animation: fadeInUp 0.4s ease forwards; /* Add forwards to keep state */
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0 0; /* Margin top only */
    font-size: 0.95rem;
    text-align: left; /* Align message text left */
    border-width: 2px;
    border-style: solid;
}

.success-message {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4CAF50;
    color: #3c763d; /* Darker green text for better readability */
}
.error-message {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    color: #a94442; /* Darker red text for better readability */
}

/* Style the retrieved password span */
.retrieved-password {
    font-weight: bold;
    color: #4644e4; /* Make it stand out */
    background-color: rgba(255, 255, 255, 0.5);
    padding: 2px 5px;
    border-radius: 4px;
    margin: 0 3px;
    font-family: monospace; /* Use monospace font */
    font-size: 1.1em;
}

/* Hover effects */
.idgen-form-wrapper:hover, .password-login-form:hover {
     transform: translateY(-5px) scale(1.01); /* Add subtle scale */
     box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
 }

.password-login-form button:hover, .idgen-form-class button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(70, 68, 228, 0.45);
    background: linear-gradient(135deg, #5a58e9, #3c3ad1); /* Slightly lighter gradient on hover */
}
.password-login-form button:active, .idgen-form-class button:active {
    transform: translateY(0px);
    box-shadow: 0 3px 10px rgba(70, 68, 228, 0.3);
}

/* Disabled button style */
.password-login-form button:disabled, .idgen-form-class button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(70, 68, 228, 0.2);
    background: gray;
}

/* Accessibility */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important; /* Use !important to override potential theme styles */
	width: 1px;
	word-wrap: normal !important;
}