/*
 * Connect the Montserrat Font
 */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at 50% 111%, rgba(12, 45, 59, 1) 0%, rgba(11, 11, 12, 1) 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    font-family: 'Montserrat', sans-serif;
    color: #FFFFFF;
    overflow: auto;
    position: relative;
}

/* Background image with gradient overlay */
.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(180deg, rgba(10, 11, 11, 1) 11%, rgba(10, 11, 11, 0) 100%),
        url('../images/background-1920.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* Main login container */
.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(24px, 14.33vh, 129px);
    padding-top: clamp(40px, 12.56vh, 113px);
}

.logo {
    width: 194px;
    height: auto;
}

/* Glassmorphic form card */
.login-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.login-heading {
    font-weight: 500;
    font-size: clamp(28px, 3.5vw, 40px);
    line-height: 1.2em;
    text-align: center;
}

.error-message {
    color: #ff4d4d;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.form-container {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.25);
    border-left-color: rgba(255, 255, 255, 0.18);
    border-right-color: rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 32px;
    width: 500px;
    max-width: 90vw;
}

.form-container form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Input fields */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.25);
    border-left-color: rgba(255, 255, 255, 0.18);
    border-right-color: rgba(255, 255, 255, 0.18);
    background: transparent;
    transition: border-color 0.2s;
}

.input-row:focus-within {
    border-color: rgba(50, 215, 224, 0.5);
}

.input-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.input-row input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5em;
    min-width: 0;
}

.input-row input::placeholder {
    color: #7E7E7E;
}

.input-row input:-webkit-autofill,
.input-row input:-webkit-autofill:hover,
.input-row input:-webkit-autofill:focus,
.input-row input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: #FFFFFF !important;
    background-color: transparent !important;
    transition: background-color 5000s ease-in-out 0s;
}

.toggle-password {
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.toggle-password:hover {
    opacity: 1;
}


/* Login button */
.login-btn {
    width: 100%;
    height: 44px;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: linear-gradient(141deg, rgba(50, 215, 224, 1) 0%, rgba(81, 167, 203, 1) 39%, rgba(0, 115, 163, 1) 92%);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5em;
    color: #FFFFFF;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    text-align: center;
}

.login-btn:hover {
    opacity: 0.9;
}

.login-btn:active {
    transform: scale(0.99);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .login-wrapper {
        gap: 20px;
        padding: 40px 20px;
        width: 100%;
        min-height: 100vh;
        justify-content: flex-start;
    }

    .login-card {
        gap: 24px;
        width: 100%;
        margin: auto 0;
    }

    .form-container {
        width: 100%;
        max-width: 100%;
        padding: 32px 20px;
    }

    .login-heading {
        font-size: 28px;
    }

    .form-container form {
        gap: 32px;
    }

    .input-row input {
        font-size: 16px;
    }

    .input-row {
        padding: 14px 20px;
    }

}

@media (max-width: 400px) {
    .login-wrapper {
        gap: 30px;
        padding: 40px 16px 32px;
    }

    .form-container {
        padding: 20px 16px;
    }

    .login-heading {
        font-size: 24px;
    }

    .logo {
        width: 150px;
    }
}

/* Height-based breakpoint for short viewports (e.g. 1080p at 150% scaling) */
@media (max-height: 750px) {
    .login-heading {
        font-size: 28px;
    }
}

/* Responsive background images */
@media (max-width: 1280px) {
    .bg-image {
        background-image:
            linear-gradient(180deg, rgba(10, 11, 11, 1) 11%, rgba(10, 11, 11, 0) 100%),
            url('../images/background-1280.jpg');
    }
}

@media (max-width: 768px) {
    .bg-image {
        background-image:
            linear-gradient(180deg, rgba(10, 11, 11, 1) 11%, rgba(10, 11, 11, 0) 100%),
            url('../images/background-768.jpg');
    }
}