* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    color: #1f2937;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 16px !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
}

.login-container {
    width: 100%;
    max-width: 460px;
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
}

.login-header {
    position: relative;
    overflow: hidden;
    padding: 28px 32px 22px;
    text-align: center;
    background: linear-gradient(135deg, #45586a 0%, #3a4a5a 100%);
}

.login-header::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.3;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.13) 0 1px, transparent 1.5px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0 1px, transparent 1.5px);
    background-size: 48px 48px;
}

.login-logo {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 76px;
    margin-bottom: 10px;
}

.login-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 260px;
    max-height: 82px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.welcome-text {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    color: #fff;
}

.welcome-title {
    margin: 0;
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.login-form {
    padding: 24px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-form .form-input {
    width: 100%;
    height: 48px;
    padding: 0 46px 0 48px;
    color: #1f2937;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-form .form-input::placeholder {
    color: #9ca3af;
}

.login-form .form-input:focus {
    border-color: #45586a;
    box-shadow: 0 0 0 4px rgba(69, 88, 106, 0.1);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    padding: 6px;
    color: #9ca3af;
    background: none;
    border: 0;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus {
    color: #45586a;
    outline: none;
}

.remember-forgot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 25px;
    font-size: 13px;
}

.custom-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
    color: #374151;
    cursor: pointer;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.custom-checkbox .checkmark {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.custom-checkbox input:checked ~ .checkmark {
    background: #45586a;
    border-color: #45586a;
}

.custom-checkbox .checkmark::after {
    position: absolute;
    top: 1px;
    left: 5px;
    display: none;
    width: 5px;
    height: 10px;
    content: "";
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark::after {
    display: block;
}

.forgot-link {
    color: #45586a !important;
    font-weight: 500;
    text-decoration: none;
}

.forgot-link:hover {
    color: #3a4a5a !important;
    text-decoration: underline;
}

.login-button {
    position: relative;
    width: 100%;
    height: 48px;
    padding: 0 18px;
    color: #fff;
    background: linear-gradient(135deg, #45586a, #3a4a5a);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(69, 88, 106, 0.3);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-button:hover,
.login-button:focus {
    color: #fff;
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(69, 88, 106, 0.4);
}

.login-button.loading {
    color: transparent !important;
    pointer-events: none;
}

.login-button.loading::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    content: "";
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 0.8s linear infinite;
}

.error-message {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    color: #dc2626;
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    font-size: 14px;
}

.error-message i {
    margin-right: 10px;
}

.login-footer {
    margin-top: 25px;
    color: #6b7280;
    text-align: center;
    font-size: 12px;
}

.login-footer p {
    margin: 0;
}

#back-top,
#opener,
#footerWrap {
    display: none !important;
}

@keyframes login-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 576px) {
    body.login-page {
        justify-content: flex-start;
        padding: 12px;
    }

    .login-container {
        max-width: 100%;
        margin: auto 0;
        border-radius: 14px;
    }

    .login-header {
        padding: 18px 18px 14px;
    }

    .login-logo {
        min-height: 60px;
        margin-bottom: 6px;
    }

    .login-logo img {
        max-width: 220px;
        max-height: 68px;
    }

    .welcome-title {
        font-size: 20px;
    }

    .login-form {
        padding: 18px;
    }

    .login-form .form-group {
        margin-bottom: 14px;
    }

    .login-form .form-input,
    .login-button {
        height: 44px;
        font-size: 15px;
    }

    .remember-forgot {
        align-items: flex-start;
        gap: 10px;
    }
}
