* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: clamp(16px, 4vw, 40px);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); /* Blue/Purple Gradient */
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#authPanel {
    width: 100%;
}

.login-card {
    background: white;
    padding: clamp(22px, 5vw, 40px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    max-width: 900px;
    width: min(100%, 900px);
    margin: 0 auto;
    align-items: center;
    gap: clamp(24px, 5vw, 50px);
}

.illustration {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-icon {
    width: min(250px, 100%);
    aspect-ratio: 1;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 100px;
    border: 8px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-container {
    flex: 1 1 0;
    min-width: 0;
    text-align: left;
}

h1 {
    color: #333;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 15px;
    position: relative;
}

input {
    display: block;
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-sizing: border-box;
    font-size: 16px;
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #4CAF50; /* Green button */
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background-color: #45a049;
}

.forgot-link {
    display: block;
    margin-top: 15px;
    font-size: 12px;
    color: #666;
    text-decoration: none;
    cursor: pointer;
}

#dashboard {
    display: none;
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #111 url("Dashboard/images/background.jpg") center / cover no-repeat;
    text-align: left;
}

#dashboard .background {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

#dashboard .name,
#dashboard .welcome,
#dashboard .menu,
#dashboard .logout-button {
    position: absolute;
    z-index: 1;
    font-family: Arial, sans-serif;
}

#dashboard .name {
    top: 30%;
    left: 30%;
    margin: 4px 0;
    color: white;
}

#dashboard .welcome {
    top: calc(30% + 38px);
    left: 30%;
    margin: 0;
    color: white;
}

#dashboard .menu {
    top: 20%;
    right: 10%;
    margin: 0;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
}

#dashboard .menu p {
    display: block;
    margin: 4px 0;
}

#dashboard .menu a,
#dashboard .menu a:visited {
    color: white;
    text-decoration: none;
}

#dashboard .menu a:hover {
    text-decoration: underline;
}

#dashboard .logout-button {
    top: calc(30% + 80px);
    left: 30%;
    width: auto;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.65);
}

@media (max-width: 600px) {
    body {
        align-items: flex-start;
    }

    .login-card {
        flex-direction: column;
        gap: 22px;
        width: 100%;
    }

    .illustration {
        display: none;
    }

    .form-container {
        width: 100%;
    }

    .form-container h1 {
        margin: 0 0 22px;
    }

    .form-container h3 {
        font-size: 1.1rem;
    }

    #dashboard {
        padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    #dashboard .name,
    #dashboard .welcome {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        margin: 0;
        text-align: center;
    }

    #dashboard .name {
        padding-top: 16vh;
    }

    #dashboard .welcome {
        margin-top: 8px;
    }

    #dashboard .menu {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-top: 32px;
        padding: 0;
        text-align: center;
    }

    #dashboard .menu p {
        margin: 0;
    }

    #dashboard .logout-button {
        position: relative;
        right: auto;
        top: auto;
        bottom: auto;
        display: block;
        margin: 64px auto 0;
        transform: none;
    }
}

@media (max-width: 380px) {
    .login-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    #dashboard {
        padding-right: 16px;
        padding-left: 16px;
    }
}
