
/* =========================================
   ADMIN LOGIN PAGE
========================================= */

.login-page {
    --login-primary: #2563eb;
    --login-primary-dark: #1d4ed8;
    --login-text: #172033;
    --login-muted: #64748b;
    --login-border: #dce3ed;

    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 55px 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f5ff, #f8fafc, #eaf1ff);
    font-family: inherit;
    isolation: isolate;
    box-sizing: border-box;
}

.login-page *,
.login-page *::before,
.login-page *::after {
    box-sizing: border-box;
}

/* Background Decorations */

.login-decoration {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
}

.decoration-one {
    width: 380px;
    height: 380px;
    top: -150px;
    left: -120px;
    background: rgba(37, 99, 235, 0.10);
}

.decoration-two {
    width: 420px;
    height: 420px;
    right: -170px;
    bottom: -180px;
    background: rgba(99, 102, 241, 0.10);
}

/* Login Card */

.login-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 38px 36px 30px;
    margin: auto;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.09);
}

/* Brand Logo */

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.brand-logo img {
    width: auto;
    max-width: 190px;
    height: 65px;
    object-fit: contain;
    border-radius: 8px;
}

/* Admin Label */

.admin-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    margin: 0 auto 16px;
    padding: 8px 13px;
    border-radius: 30px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.admin-label i {
    font-size: 13px;
}

/* Heading */

.login-card > h1 {
    margin: 0 0 28px;
    color: var(--login-text);
    font-size: 30px;
    font-weight: 750;
    line-height: 1.25;
    text-align: center;
}

/* Form Fields */

.login-field {
    width: 100%;
    margin-bottom: 21px;
}

.login-field > label,
.password-heading label,
.captcha-group > label {
    display: block;
    margin-bottom: 9px;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
}

.login-input {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    gap: 11px;
    border: 1px solid var(--login-border);
    border-radius: 10px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus-within {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.login-input > i {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 16px;
}

.login-input input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 48px;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--login-text);
    font-size: 14px;
    font-family: inherit;
}

.login-input input::placeholder {
    color: #a0aaba;
}

/* Password */

.password-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.password-heading label {
    margin-bottom: 9px;
}

#togglePassword {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 15px;
}

#togglePassword:hover {
    color: var(--login-primary);
}

/* CAPTCHA */

.captcha-group {
    width: 100%;
    margin-bottom: 23px;
}

.captcha-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 13px;
    margin-bottom: 11px;
    border: 1px dashed #b8c7dc;
    border-radius: 9px;
    background: #f8fafc;
}

#captchaQuestion {
    color: #334155;
    font-size: 14px;
    font-weight: 650;
}

#refreshCaptcha {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 7px;
    background: #eaf1ff;
    color: var(--login-primary);
    cursor: pointer;
    transition: 0.2s ease;
}

#refreshCaptcha:hover {
    background: #dbeafe;
    transform: rotate(30deg);
}

#captchaAnswer {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--login-border);
    border-radius: 9px;
    outline: none;
    background: #ffffff;
    color: var(--login-text);
    font-size: 14px;
    font-family: inherit;
}

#captchaAnswer:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

#captchaMessage {
    display: block;
    margin-top: 6px;
    color: #dc2626;
    font-size: 11px;
}

/* Submit Buttons */

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 51px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: var(--login-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 650;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.login-submit:hover:not(:disabled) {
    background: var(--login-primary-dark);
    transform: translateY(-1px);
}

.login-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Login Messages */

#adminLoginMessage,
#adminTwoFactorMessage {
    min-height: 0;
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

#adminLoginMessage:empty,
#adminTwoFactorMessage:empty {
    display: none;
}

#adminLoginMessage[data-type="error"],
#adminTwoFactorMessage[data-type="error"] {
    color: #dc2626;
}

#adminLoginMessage[data-type="success"],
#adminTwoFactorMessage[data-type="success"] {
    color: #15803d;
}

/* Two Factor Panel */

.admin-2fa-panel {
    width: 100%;
    text-align: center;
}

.admin-2fa-panel[hidden],
.login-page [hidden] {
    display: none !important;
}

.admin-2fa-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 17px;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--login-primary);
    font-size: 23px;
}

.admin-2fa-panel h2 {
    margin: 0 0 10px;
    color: var(--login-text);
    font-size: 25px;
    font-weight: 750;
}

.admin-2fa-panel > p {
    margin: 0 0 23px;
    color: var(--login-muted);
    font-size: 13px;
    line-height: 1.6;
}

.admin-2fa-panel .login-field {
    text-align: left;
}

.admin-2fa-expiry {
    margin: -8px 0 17px;
    color: #dc2626;
    font-size: 12px;
    text-align: left;
}

#adminOtp {
    letter-spacing: 5px;
    font-size: 18px;
    font-weight: 700;
}

#adminOtp::placeholder {
    letter-spacing: 4px;
}

/* 2FA Options */

.admin-2fa-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px 16px;
    margin-top: 18px;
}

.admin-2fa-link,
.admin-2fa-back {
    padding: 5px 2px;
    border: none;
    background: transparent;
    color: var(--login-primary);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.admin-2fa-link:hover,
.admin-2fa-back:hover {
    color: var(--login-primary-dark);
    text-decoration: underline;
}

.admin-2fa-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-2fa-back {
    margin-top: 14px;
    color: #64748b;
}

/* Security Footer */

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
    padding-top: 19px;
    border-top: 1px solid #edf0f5;
    color: #64748b;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.login-security i {
    color: #16a34a;
    font-size: 13px;
}

/* Bottom Caption */

.page-caption {
    position: absolute;
    bottom: 17px;
    left: 50%;
    width: 100%;
    padding: 0 12px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    transform: translateX(-50%);
}

/* =========================================
   TABLET RESPONSIVE
========================================= */

@media (max-width: 768px) {
    .login-page {
        padding: 35px 18px 55px;
    }

    .login-card {
        max-width: 420px;
        padding: 32px 28px 26px;
    }

    .login-card > h1 {
        font-size: 27px;
    }

    .decoration-one {
        width: 280px;
        height: 280px;
    }

    .decoration-two {
        width: 300px;
        height: 300px;
    }
}

/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 480px) {
    .login-page {
        align-items: center;
        padding: 24px 14px 48px;
    }

    .login-card {
        max-width: 100%;
        padding: 27px 20px 23px;
        border-radius: 16px;
    }

    .brand-logo img {
        max-width: 160px;
        height: 55px;
    }

    .brand-logo {
        margin-bottom: 18px;
    }

    .admin-label {
        margin-bottom: 13px;
        padding: 7px 11px;
        font-size: 10px;
    }

    .login-card > h1 {
        margin-bottom: 23px;
        font-size: 25px;
    }

    .login-field {
        margin-bottom: 18px;
    }

    .login-input {
        min-height: 47px;
        padding: 0 11px;
    }

    .login-input input {
        height: 45px;
        font-size: 13px;
    }

    .login-submit {
        min-height: 48px;
        font-size: 13px;
    }

    .captcha-box {
        min-height: 45px;
    }

    #captchaAnswer {
        height: 46px;
    }

    .admin-2fa-panel h2 {
        font-size: 23px;
    }

    .admin-2fa-icon {
        width: 52px;
        height: 52px;
        font-size: 21px;
    }

    .login-security {
        margin-top: 21px;
        padding-top: 16px;
        font-size: 10px;
    }

    .page-caption {
        bottom: 12px;
        font-size: 9px;
        letter-spacing: 1.5px;
    }
}

/* =========================================
   SMALL MOBILE
========================================= */

@media (max-width: 360px) {
    .login-page {
        padding-right: 10px;
        padding-left: 10px;
    }

    .login-card {
        padding: 24px 16px 20px;
    }

    .login-card > h1 {
        font-size: 23px;
    }

    .admin-2fa-options {
        gap: 8px 12px;
    }

    .admin-2fa-link,
    .admin-2fa-back {
        font-size: 11px;
    }
}

/* Short-height screens */

@media (max-height: 650px) and (min-width: 481px) {
    .login-page {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 45px;
    }

    .login-card {
        padding-top: 22px;
        padding-bottom: 20px;
    }

    .brand-logo {
        margin-bottom: 12px;
    }

    .brand-logo img {
        height: 45px;
    }

    .login-card > h1 {
        margin-bottom: 18px;
        font-size: 25px;
    }

    .login-field {
        margin-bottom: 14px;
    }

    .login-security {
        margin-top: 17px;
        padding-top: 13px;
    }
}
