:root {
    --background: #1a1a2e;
    --color: #ffffff;
    --primary-color: #0f3460;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    box-sizing: border-box;
    font-family: "poppins";
    background: var(--background);
    color: var(--color);
    letter-spacing: 1px;
    transition: background 0.2s ease;
    -webkit-transition: background 0.2s ease;
    -moz-transition: background 0.2s ease;
    -ms-transition: background 0.2s ease;
    -o-transition: background 0.2s ease;
}

a {
    text-decoration: none;
    color: var(--color);
}

h1 {
    font-size: 2.5rem;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    position: relative;
    width: 22.2rem;
}

.form-container {
    border: 1px solid hsla(0, 0%, 65%, 0.158);
    box-shadow: 0 0 36px 1px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(20px);
    z-index: 99;
    padding: 2rem;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    -ms-border-radius: 10px;
    -o-border-radius: 10px;
}

.login-container form input {
    display: block;
    padding: 14.5px;
    width: 100%;
    margin: 2rem 0;
    color: var(--color);
    outline: none;
    background-color: #9191911f;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    letter-spacing: 0.8px;
    font-size: 15px;
    backdrop-filter: blur(15px);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
}

.login-container form input:focus {
    box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.2);
    animation: wobble 0.3s ease-in;
    -webkit-animation: wobble 0.3s ease-in;
}

.login-container form button {
    background-color: var(--primary-color);
    color: var(--color);
    display: block;
    padding: 13px;
    border-radius: 5px;
    outline: none;
    font-size: 18px;
    letter-spacing: 1.5px;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
    margin-bottom: 2rem;
    transition: all 0.1s ease-in-out;
    border: none;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    -webkit-transition: all 0.1s ease-in-out;
    -moz-transition: all 0.1s ease-in-out;
    -ms-transition: all 0.1s ease-in-out;
    -o-transition: all 0.1s ease-in-out;
}

.login-container form button:hover {
    box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
    -webkit-transform: scale(1.02);
    -moz-transform: scale(1.02);
    -ms-transform: scale(1.02);
    -o-transform: scale(1.02);
}

.circle {
    width: 8rem;
    height: 8rem;
    background: var(--primary-color);
    border-radius: 50%;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    position: absolute;
}

.illustration {
    position: absolute;
    top: -20%;
    right: -40%;
    width: 100%;
    opacity: 0.75;
}

.circle-one {
    top: 0;
    left: 0;
    z-index: -1;
    transform: translate(-45%, -45%);
    -webkit-transform: translate(-45%, -45%);
    -moz-transform: translate(-45%, -45%);
    -ms-transform: translate(-45%, -45%);
    -o-transform: translate(-45%, -45%);
}

.circle-two {
    bottom: 0;
    right: 0;
    z-index: -1;
    transform: translate(45%, 45%);
    -webkit-transform: translate(45%, 45%);
    -moz-transform: translate(45%, 45%);
    -ms-transform: translate(45%, 45%);
    -o-transform: translate(45%, 45%);
}

.register-forget {
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.opacity {
    opacity: 0.8;
    z-index: 100;
}

.student-login {
    font-size: 2.25rem;
    display: flex;
    flex-direction: row;
}

.theme-btn-container {
    position: absolute;
    left: 0;
    bottom: 2rem;
}

.theme-btn {
    cursor: pointer;
    transition: all 0.3s ease-in;
}

.theme-btn:hover {
    width: 40px !important;
}

.support-modal,
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.support-modal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: fit-content;
    height: fit-content;
    margin: auto;
    padding: 2rem;
    border-radius: 12px;
    background: rgba(15, 52, 96, 0.95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    gap: 1.25rem;
    opacity: 1;
    transform: translateY(0);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.support-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.support-modal__header h2 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.support-modal__close {
    position: absolute;
    top: 2%;
    right: 3%;
    background: transparent;
    border: none;
    color: var(--color);
    font-size: 1.75rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.support-modal__close:hover {
    transform: scale(1.1);
}

.support-modal__content p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.8;
}

.support-modal__contact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.support-modal__contact a {
    color: var(--color);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: underline;
}

.support-modal__contact a:hover {
    text-decoration: none;
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.65);
    z-index: 998;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.hidden .support-modal {
    transform: translateY(16px);
}

.hidden+.modal-backdrop,
.hidden.modal-backdrop {
    opacity: 0;
}

@supports (backdrop-filter: blur(10px)) {
    .support-modal {
        backdrop-filter: blur(18px);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .modal-backdrop {
        backdrop-filter: blur(5px);
    }
}

@keyframes wobble {
    0% {
        transform: scale(1.025);
        -webkit-transform: scale(1.025);
        -moz-transform: scale(1.025);
        -ms-transform: scale(1.025);
        -o-transform: scale(1.025);
    }

    25% {
        transform: scale(1);
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -ms-transform: scale(1);
        -o-transform: scale(1);
    }

    75% {
        transform: scale(1.025);
        -webkit-transform: scale(1.025);
        -moz-transform: scale(1.025);
        -ms-transform: scale(1.025);
        -o-transform: scale(1.025);
    }

    100% {
        transform: scale(1);
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -ms-transform: scale(1);
        -o-transform: scale(1);
    }
}

.form-container .form-subtitle {
    margin: -0.5rem 0 1.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.form-block {
    margin-bottom: 1.5rem;
}

.form-block:last-of-type {
    margin-bottom: 1rem;
}

.form-block button {
    margin-top: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-group label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.75;
}

.input-group input {
    margin: 0;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
}

.form-divider::before,
.form-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.form-subtitle a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.form-subtitle a:hover {
    text-decoration: none;
}

/* ===== Tablet ===== */
@media (max-width: 992px) {
    .login-container {
        width: 26rem;
    }
}

/* ===== Mobile (768px and below) ===== */
@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, #0f1a3d 0%, #1a1a2e 40%, #16213e 100%);
        min-height: 100vh;
        overflow-x: hidden;
    }

    .container {
        padding: 15px;
        min-height: 100vh;
        align-items: center;
        /* Center on mobile to look better than stretch */
        display: flex;
    }

    .login-container {
        width: 100%;
        max-width: 420px;
        margin: auto;
        animation: mobileFloat 3s ease-in-out infinite alternate;
    }

    @keyframes mobileFloat {
        from {
            transform: translateY(0);
        }

        to {
            transform: translateY(-5px);
        }
    }

    .form-container {
        padding: 2rem 1.5rem;
        width: 100%;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.03);
        backdrop-filter: blur(10px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    }

    /* Logo / Illustration - centered and proper size */
    .illustration {
        position: static !important;
        width: 90px !important;
        height: 90px !important;
        display: block !important;
        margin: 0 auto 1.25rem auto !important;
        opacity: 1 !important;
        object-fit: contain;
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    }

    /* Hide background circles */
    .circle {
        display: none !important;
    }

    /* Title */
    h1,
    h2 {
        font-size: 1.6rem !important;
        text-align: center !important;
        margin-bottom: 1.5rem !important;
        letter-spacing: 2px;
    }

    /* Inputs */
    .login-container form input {
        padding: 16px 14px;
        font-size: 16px;
        /* Prevents iOS zoom */
        margin: 1.2rem 0;
        border-radius: 12px;
        background-color: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .login-container form input:focus {
        border-color: rgba(255, 255, 255, 0.4);
        background-color: rgba(255, 255, 255, 0.12);
        box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.4);
    }

    /* Submit button */
    .login-container form button {
        padding: 16px;
        font-size: 15px;
        margin-bottom: 1.5rem;
        border-radius: 12px;
        letter-spacing: 2px;
        box-shadow: 0 6px 20px rgba(15, 52, 96, 0.5);
    }

    /* Links below form */
    .register-forget {
        gap: 0.6rem;
        font-size: 0.8rem;
        flex-wrap: wrap;
        text-align: center;
    }

    /* Support modal */
    .support-modal {
        width: calc(100% - 2rem);
        margin: 1rem;
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }
}

/* ===== Small phones (max 480px) ===== */
@media (max-width: 480px) {
    .form-container {
        padding: 2rem 1.5rem 2.5rem;
    }

    .illustration {
        width: 75px !important;
        height: 75px !important;
    }

    h2 {
        font-size: 1.4rem !important;
        margin-bottom: 1.25rem !important;
    }

    .login-container form input {
        padding: 15px 12px;
        margin: 1rem 0;
    }

    .register-forget {
        flex-direction: column;
        gap: 0.6rem;
        align-items: center;
    }
}

/* ===== Desktop large ===== */
@media (min-width: 1200px) {
    .login-container {
        width: 26rem;
    }

    h1 {
        font-size: 3rem;
    }
}

/* ===== Role Selection Dropdown Styling ===== */
.input-group select {
    display: block;
    width: 100%;
    padding: 14.5px;
    margin: 0;
    color: var(--color);
    background-color: #9191911f;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    letter-spacing: 0.8px;
    font-size: 15px;
    outline: none;
    backdrop-filter: blur(15px);
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
}

.input-group select::-ms-expand {
    display: none;
}

.input-group select:focus {
    box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.2);
    animation: wobble 0.3s ease-in;
}

.input-group select option {
    background-color: #f8f8f8;
    /* dropdown background */
    color: #333;
    /* text color for readability */
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 10px;
}

.input-group select option:hover {
    background-color: #e1e1e1;
}

@supports (-webkit-backdrop-filter: blur(10px)) {
    .input-group select option {
        backdrop-filter: blur(6px);
    }
}