@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
    --primary-color: #8B5CF6; /* purple-500 */
    --secondary-color: #4F46E5; /* indigo-600 */
    --background-color: #121212;
    --surface-color: #1E1E1E;
    --text-color: #E5E7EB; /* gray-200 */
    --text-gray-400: #9CA3AF; /* gray-400 */
    --input-bg-color: rgba(255, 255, 255, 0.05);
    --input-border-color: transparent;
    --input-focus-ring-color: rgba(139, 92, 246, 0.5);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#tsparticles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 1rem;
}

.login-modal {
    background-color: var(--surface-color);
    padding: 3rem 5vw; /* Increased top/bottom padding, responsive horizontal padding */
    border-radius: 1rem; /* Slightly more rounded corners */
    width: 100%;
    max-width: 420px; /* Slightly wider */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4); /* Softer, larger shadow */
    animation: fadeIn 0.5s ease-out both;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    max-height: 95vh; /* Limit modal height to viewport */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-modal .logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-modal .logo img {
    width: 140px;
    max-width: 100%;
}

.login-modal h1 {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    background-color: var(--input-bg-color);
    border: 1px solid var(--input-border-color);
    border-radius: 0.5rem; /* rounded-md */
    color: var(--text-color);
    height: 3rem; /* h-12 */
    padding: 0.75rem 1rem; /* py-3 px-4 */
    font-size: 0.875rem; /* text-sm */
    width: 100%;
    box-sizing: border-box; /* Ensure consistent sizing */
    transition: box-shadow 0.2s ease-in-out;
    -webkit-appearance: none; /* Removes default browser styling */
    -moz-appearance: none;
    appearance: none;
}

#token {
    text-align: center;
    width: 250px; /* Increased width */
    margin: 0 auto;
    display: block;
}
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px var(--input-bg-color) inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-control:-internal-autofill-selected {
    background-color: var(--input-bg-color) !important;
    color: var(--text-color) !important;
}

.form-control::placeholder {
    color: var(--text-gray-400);
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--input-focus-ring-color); /* focus:ring-2 */
}

.form-group.password-wrapper {
    position: relative;
}

.form-group.password-wrapper .form-control {
    padding-right: 1rem; /* Ensure consistent padding */
}

.toggle-password {
    position: absolute;
    right: 0.75rem; /* Aligned with general input padding */
    top: 50%;
    transform: translateY(calc(-50% + 0.5rem));
    cursor: pointer;
    color: var(--text-gray-400);
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-color);
}


.button-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem; /* Adjust as needed */
    gap: 1rem; /* Space between buttons */
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.button-container .btn-login {
    flex: 1; /* Allow buttons to grow and shrink */
    min-width: 120px; /* Minimum width for buttons */
    max-width: 180px; /* Maximum width for buttons */
}

@media (max-width: 500px) {
    .button-container .btn-login {
        min-width: unset; /* Remove min-width on small screens */
        max-width: unset; /* Remove max-width on small screens */
        width: 100%; /* Full width on small screens */
    }
}

.btn-login {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 0.5rem; /* rounded-md */
    color: white;
    height: 3.5rem; /* h-14 */
    font-size: 1rem;
    font-weight: 600; /* font-semibold */
    cursor: pointer;
    transition: filter 0.2s ease-in-out;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}


.btn-login:hover {
    filter: brightness(1.15);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.extra-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem; /* text-sm */
    margin-top: 1rem;
}

.form-check-label {
    font-weight: 500;
    color: var(--text-gray-400);
}

.forgot-password-link {
    color: var(--text-gray-400);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.register-link {
    text-align: center;
    margin-top: 2.5rem; /* Increased margin-top */
    font-size: 0.9rem; /* Slightly larger font */
}

.register-link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.register-link a:hover {
    text-decoration: underline;
}

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px var(--input-bg-color) inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-control:-internal-autofill-selected {
    background-color: var(--input-bg-color) !important;
    color: var(--text-color) !important;
}

/* Custom scrollbar styles */
.form-scroll-area::-webkit-scrollbar {
    width: 0.5em;
}

.form-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.form-scroll-area::-webkit-scrollbar-thumb {
    background: transparent;
}

.form-scroll-area {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    flex-grow: 1; /* Allow this area to take up available space */
    overflow-y: auto;
}

@media (max-width: 500px) {
    .login-modal {
        padding: 2rem 1rem; /* Adjust padding for smaller screens */
    }

    .login-modal h1 {
        font-size: 1.2rem; /* Adjust heading font size */
    }

    .form-group label,
    .form-control,
    .extra-options,
    .register-link {
        font-size: 0.8rem; /* Adjust general font sizes */
    }

    .btn-login {
        font-size: 0.85rem; /* Adjust button font size */
        height: 2.8rem;
    }
}
