/* Universal box-sizing for better responsiveness */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2a3a, #2c3e50); /* Deeper, more modern gradient */
    margin: 0;
    color: #e0e6ed; /* Softer light text color */
    overflow: hidden; /* Prevent scrollbars from background effects */
}

.container {
    background-color: rgba(30, 42, 54, 0.95); /* Slightly more opaque dark background */
    padding: 30px;
    border-radius: 15px; /* Slightly less rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); /* Refined shadow */
    text-align: center;
    width: 90%;
    max-width: 400px; /* Even narrower container */
    border: 1px solid rgba(60, 80, 100, 0.5); /* Subtle, lighter border */
    backdrop-filter: blur(10px); /* Stronger frosted glass effect */
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    position: relative;
    z-index: 1;
    animation: fadeIn 0.7s ease-out;
}

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

.logo {
    width: 90px; /* Smaller logo */
    height: 90px;
    margin-bottom: 25px;
    border-radius: 50%;
    background-color: #2a3b4c; /* Darker background for logo */
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4); /* Refined shadow */
    border: 3px solid #007bff; /* Vibrant accent border for logo */
    transition: transform 0.2s ease-in-out;
}

.logo:hover {
    transform: scale(1.03) rotate(3deg);
}

h1 {
    color: #007bff; /* Primary accent color */
    margin-bottom: 20px;
    font-size: 2.2em; /* Smaller heading */
    letter-spacing: 1.2px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}



.form-section {
    margin-bottom: 20px;
    padding-top: 15px;
}

h2 {
    color: #e0e6ed;
    margin-bottom: 18px;
    font-size: 1.8em;
    font-weight: 600;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Reduced gap */
}

.input-group {
    position: relative;
    display: flex;
    justify-content: center;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #3a4f60;
    border-radius: 6px; /* Even less rounded input fields */
    font-size: 0.95em;
    background-color: #2a3b4c; /* Darker input background */
    color: #e0e6ed;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
    color: #aab8c2; /* Softer placeholder text */
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.2); /* Subtle text shadow */
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: #007bff; /* Vibrant accent color on focus */
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5); /* Refined glow effect */
    background-color: #203040; /* Slightly darker on focus */
}

select {
    -webkit-appearance: none; /* Remove default browser styling for select */
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292%22%20height%3D%22292%22%20viewBox%3D%220%200%20292%20292%22%3E%3Cpath%20fill%3D%22%23e0e6ed%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13.2-5.4H18.2c-5%200-9.3%201.8-13.2%205.4A17.6%2017.6%200%200%010%2082.6c0%204.8%201.8%209.3%205.4%2013.2l128%20128c3.9%203.9%208.4%205.4%2013.2%205.4s9.3-1.8%2013.2-5.4l128-128c3.9-3.9%205.4-8.4%205.4-13.2%200-4.8-1.8-9.3-5.4-13.2z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    background-size: 10px auto;
}

option {
    background-color: #2a3b4c;
    color: #e0e6ed;
}

button {
    background: linear-gradient(45deg, #007bff, #0056b3); /* Gradient button */
    color: white;
    width: calc(100% - 20px); /* Match input field width */
    padding: 14px 0; /* Adjust vertical padding, horizontal padding will be handled by width */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button.loading {
    cursor: not-allowed;
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

button.error {
    background: linear-gradient(45deg, #ff6b6b, #ff0000);
}

button:hover {
    background: linear-gradient(45deg, #0056b3, #004085); /* Darker gradient on hover */
    transform: translateY(-2px) scale(1.01); /* Subtle lift and scale */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.message {
    margin-top: 20px;
    font-weight: bold;
    color: #ff6b6b; /* More vibrant error/message color */
    font-size: 1em;
}

.toggle-text {
    margin-top: 20px;
    font-size: 0.95em;
    color: #c0ccda;
}

.toggle-text a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.toggle-text a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Background animation */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="25" cy="25" r="5" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="5" fill="rgba(255,255,255,0.05)"/></svg>') repeat;
    animation: backgroundPan 60s linear infinite;
    opacity: 0.3;
    z-index: 0;
}

@keyframes backgroundPan {
    from { background-position: 0 0; }
    to { background-position: 1000px 1000px; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .container {
        max-width: 380px;
        padding: 25px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.7em;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    select {
        padding: 9px;
        font-size: 0.9em;
    }

    button {
        padding: 12px 22px;
        font-size: 1em;
    }

    .logo {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 350px;
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.5em;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    select {
        padding: 8px;
        font-size: 0.85em;
    }

    button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .logo {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
}

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

    h1 {
        font-size: 1.6em;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }

    form {
        gap: 10px;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    select {
        padding: 7px;
        font-size: 0.8em;
    }

    button {
        padding: 9px 18px;
        font-size: 0.85em;
    }

    .message,
    .toggle-text {
        font-size: 0.85em;
    }

    .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
}

/* Larger screens adjustments */
@media (min-width: 1400px) {
    .container {
        max-width: 480px;
        padding: 40px;
    }

    h1 {
        font-size: 2.6em;
    }

    h2 {
        font-size: 2.2em;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    select {
        padding: 14px;
        font-size: 1.05em;
    }

    button {
        padding: 18px 30px;
        font-size: 1.2em;
    }

    .logo {
        width: 100px;
        height: 100px;
    }
}