:root {
    --apk-text: #12223d;
    --apk-muted: #667085;
    --apk-border: #dbe7f7;
    --apk-soft: #f4f8ff;
    --apk-blue: #2563eb;
    --apk-sky: #38bdf8;
    --apk-pink: #ec4899;
    --apk-purple: #7c3aed;
    --apk-shadow: 0 24px 70px rgba(37, 99, 235, .14);
}

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

body {
    margin: 0;
    background: #f8fbff !important;
}

.apk-login-page,
.apk-login-page * {
    box-sizing: border-box !important;
}

.apk-login-page {
    min-height: 100vh;
    padding: 32px;
    display: grid;
    place-items: center;
    color: var(--apk-text);
    font-family: Inter, Nunito, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 12% 16%, rgba(236, 72, 153, .14), transparent 25%),
        radial-gradient(circle at 90% 10%, rgba(37, 99, 235, .18), transparent 26%),
        linear-gradient(135deg, #ffffff 0%, #f4f9ff 54%, #fff7fb 100%);
}

.apk-login-wrap {
    width: min(1120px, 100%);
    min-height: 640px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 26px;
    padding: 18px;
    border: 1px solid rgba(219, 231, 247, .9);
    border-radius: 32px;
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--apk-shadow);
    backdrop-filter: blur(16px);
}

.apk-login-side,
.apk-login-card {
    border: 1px solid rgba(219, 231, 247, .9);
    background: rgba(255, 255, 255, .9);
    border-radius: 26px;
}

.apk-login-side {
    position: relative;
    overflow: hidden;
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at 22% 12%, rgba(236, 72, 153, .10), transparent 32%),
        radial-gradient(circle at 78% 40%, rgba(56, 189, 248, .14), transparent 34%),
        linear-gradient(145deg, #ffffff 0%, #eef7ff 100%);
}

.apk-login-side::before {
    content: "";
    position: absolute;
    inset: auto -120px -210px -120px;
    height: 320px;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(219,234,254,.86));
}

.apk-brand-row,
.apk-card-title {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
}

.apk-logo,
.apk-card-logo {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: #fff;
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -.04em;
    background: linear-gradient(135deg, var(--apk-blue), var(--apk-purple) 55%, var(--apk-pink));
    box-shadow: 0 15px 30px rgba(37, 99, 235, .22);
}

.apk-brand-row strong {
    display: block;
    font-size: 25px;
    font-weight: 950;
    line-height: 1.05;
    letter-spacing: -.04em;
}

.apk-brand-row small {
    display: block;
    margin-top: 5px;
    color: var(--apk-muted);
    font-size: 15px;
    font-weight: 750;
}

.apk-printer-card {
    position: relative;
    z-index: 2;
    width: min(580px, 100%);
    min-height: 390px;
    margin: 20px auto;
    border-radius: 30px;
    border: 1px solid rgba(219, 231, 247, .95);
    background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(239,246,255,.84));
    box-shadow: 0 22px 55px rgba(15, 23, 42, .10);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.apk-printer-card::before,
.apk-printer-card::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    opacity: .7;
}

.apk-printer-card::before {
    width: 180px;
    height: 180px;
    left: -74px;
    top: 36px;
    background: rgba(236, 72, 153, .10);
}

.apk-printer-card::after {
    width: 220px;
    height: 220px;
    right: -90px;
    bottom: -76px;
    background: rgba(37, 99, 235, .10);
}

.apk-printer-top {
    position: absolute;
    z-index: 4;
    top: 60px;
    display: flex;
    gap: 10px;
}

.apk-printer-top span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 52px;
    border-radius: 12px 12px 14px 14px;
    color: #fff;
    font-weight: 950;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .14);
    animation: apkFloat 3s ease-in-out infinite;
}

.apk-printer-top span:nth-child(1) { background: linear-gradient(180deg, #67e8f9, #0284c7); }
.apk-printer-top span:nth-child(2) { background: linear-gradient(180deg, #f9a8d4, #db2777); animation-delay: .15s; }
.apk-printer-top span:nth-child(3) { background: linear-gradient(180deg, #fde68a, #f59e0b); animation-delay: .3s; }
.apk-printer-top span:nth-child(4) { background: linear-gradient(180deg, #64748b, #0f172a); animation-delay: .45s; }

.apk-printer-machine {
    position: relative;
    z-index: 3;
    width: min(370px, 82%);
    height: 190px;
    margin-top: 42px;
    border-radius: 28px 34px 34px 34px;
    background: linear-gradient(180deg, #ffffff 0%, #eef4fb 62%, #d9e4f2 100%);
    box-shadow:
        inset 0 8px 18px rgba(255,255,255,.92),
        inset 0 -18px 28px rgba(15,23,42,.08),
        0 30px 55px rgba(15,23,42,.14);
    animation: apkPrinter 5s ease-in-out infinite;
}

.apk-printer-screen {
    position: absolute;
    left: 28px;
    top: 36px;
    width: 84px;
    height: 58px;
    padding: 10px;
    border-radius: 16px;
    background: #10213f;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.06);
}

.apk-printer-screen i {
    display: block;
    height: 7px;
    margin-bottom: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--apk-sky), var(--apk-blue));
}

.apk-printer-screen i:nth-child(2) { width: 70%; background: linear-gradient(90deg, var(--apk-pink), var(--apk-purple)); }
.apk-printer-screen i:nth-child(3) { width: 48%; background: linear-gradient(90deg, #facc15, #fb7185); }

.apk-printer-mouth {
    position: absolute;
    left: 128px;
    top: 54px;
    width: 190px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1f2937, #0f172a);
}

.apk-printer-paper {
    position: absolute;
    left: 152px;
    top: 70px;
    width: 142px;
    height: 128px;
    padding: 16px;
    border-radius: 0 0 18px 18px;
    background: #fff;
    box-shadow: 0 18px 30px rgba(15,23,42,.10);
    animation: apkPaper 3.8s ease-in-out infinite;
}

.apk-printer-paper b {
    display: block;
    color: var(--apk-blue);
    font-size: 26px;
    line-height: 1;
    font-weight: 950;
}

.apk-printer-paper em {
    display: block;
    height: 8px;
    margin-top: 10px;
    border-radius: 999px;
    background: #dbeafe;
}

.apk-printer-paper em:nth-of-type(2) { width: 70%; background: #fce7f3; }

.apk-printer-paper div {
    display: flex;
    gap: 7px;
    margin-top: 14px;
}

.apk-printer-paper i {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--apk-blue);
}

.apk-printer-paper i:nth-child(2) { background: var(--apk-pink); }
.apk-printer-paper i:nth-child(3) { background: var(--apk-sky); }

.apk-print-items {
    position: absolute;
    z-index: 4;
    left: 30px;
    right: 30px;
    bottom: 26px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.apk-print-items div {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(219, 231, 247, .92);
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 10px 24px rgba(15,23,42,.07);
}

.apk-print-items b {
    display: block;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

.apk-print-items span {
    display: block;
    width: 72%;
    height: 7px;
    margin-top: 10px;
    border-radius: 999px;
    background: #dbeafe;
}

.apk-side-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(219, 231, 247, .9);
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    color: var(--apk-muted);
    font-weight: 850;
}

.apk-side-footer i {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--apk-blue);
}

.apk-login-card {
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .07);
}

.apk-card-logo {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    font-size: 17px;
}

.apk-card-title h1 {
    margin: 0;
    color: var(--apk-text);
    font-size: 36px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.045em;
}

.apk-card-title p {
    margin: 8px 0 0;
    color: var(--apk-muted);
    font-size: 16px;
    font-weight: 750;
}

.apk-alert {
    margin-top: 28px;
    padding: 14px 16px;
    border: 1px solid #fecdd3;
    border-radius: 16px;
    background: #fff1f2;
    color: #be123c;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 750;
}

.apk-login-form {
    margin-top: 30px;
}

.apk-field {
    margin-bottom: 20px;
}

.apk-field label {
    display: block;
    margin: 0 0 9px;
    color: var(--apk-text);
    font-size: 15px;
    line-height: 1.2;
    font-weight: 900;
}

.apk-input-wrap {
    position: relative;
    height: 58px;
    border: 1px solid var(--apk-border);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.apk-input-wrap:focus-within {
    border-color: rgba(37, 99, 235, .68);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10), 0 10px 24px rgba(15, 23, 42, .06);
}

.apk-field-icon {
    position: absolute;
    left: 17px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    color: var(--apk-blue);
    pointer-events: none;
}

.apk-field-icon svg,
.apk-password-toggle svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.apk-input-wrap input {
    display: block !important;
    width: 100% !important;
    height: 56px !important;
    min-height: 56px !important;
    margin: 0 !important;
    padding: 0 18px 0 54px !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--apk-text) !important;
    font-size: 16px !important;
    line-height: 56px !important;
    font-weight: 750 !important;
}

.apk-password-wrap input {
    padding-right: 58px !important;
}

.apk-input-wrap input::placeholder {
    color: #98a2b3 !important;
    opacity: 1 !important;
}

.apk-password-toggle {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    display: grid !important;
    place-items: center !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
    border: 0 !important;
    border-radius: 13px !important;
    background: #eef5ff !important;
    color: var(--apk-blue) !important;
    cursor: pointer;
}

.apk-password-toggle:hover {
    background: #dbeafe !important;
}

.apk-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    margin: -2px 0 22px;
}

.apk-remember {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    color: var(--apk-muted);
    font-size: 15px;
    line-height: 1.2;
    font-weight: 750;
    cursor: pointer;
}

.apk-remember input {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    accent-color: var(--apk-blue);
}

.apk-submit-btn {
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    height: 58px !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, var(--apk-blue), var(--apk-purple)) !important;
    box-shadow: 0 16px 32px rgba(37, 99, 235, .25) !important;
    color: #fff !important;
    font-size: 17px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    cursor: pointer;
}

.apk-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 38px rgba(37, 99, 235, .30) !important;
}

.apk-login-help {
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #f4f8ff;
    color: var(--apk-muted);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 750;
    text-align: center;
}

.apk-login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
    color: #8a98ad;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 850;
}

@keyframes apkFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes apkPrinter {
    0%, 100% { transform: translateY(0) rotateX(0deg); }
    50% { transform: translateY(-6px) rotateX(1deg); }
}

@keyframes apkPaper {
    0%, 100% { transform: translateY(-10px); }
    50% { transform: translateY(8px); }
}

@media (max-width: 1024px) {
    .apk-login-wrap {
        grid-template-columns: 1fr;
        width: min(620px, 100%);
        min-height: auto;
    }

    .apk-login-side {
        min-height: 420px;
    }

    .apk-printer-card {
        min-height: 300px;
    }

    .apk-printer-top {
        top: 36px;
    }

    .apk-printer-machine {
        width: min(330px, 86%);
        height: 170px;
    }

    .apk-print-items {
        display: none;
    }
}

@media (max-width: 640px) {
    .apk-login-page {
        padding: 14px;
        display: block;
    }

    .apk-login-wrap {
        padding: 12px;
        gap: 12px;
        border-radius: 24px;
    }

    .apk-login-side {
        min-height: 250px;
        padding: 22px;
        border-radius: 20px;
    }

    .apk-brand-row strong {
        font-size: 21px;
    }

    .apk-brand-row small {
        font-size: 13px;
    }

    .apk-logo {
        width: 50px;
        height: 50px;
        border-radius: 16px;
        font-size: 16px;
    }

    .apk-printer-card {
        display: none;
    }

    .apk-side-footer {
        margin-top: 22px;
        padding: 12px;
        font-size: 13px;
        flex-wrap: wrap;
    }

    .apk-login-card {
        padding: 24px;
        border-radius: 20px;
    }

    .apk-card-title h1 {
        font-size: 31px;
    }

    .apk-input-wrap,
    .apk-submit-btn {
        height: 56px !important;
        border-radius: 16px !important;
    }

    .apk-input-wrap input {
        height: 54px !important;
        min-height: 54px !important;
        line-height: 54px !important;
        font-size: 15px !important;
    }

    .apk-login-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* APK 2027 login dark-mode password eye fix.
   Global dark-mode button rules set all buttons to position:relative, which pushes
   the password eye out of the password field. This page-specific rule loads after
   global CSS through part/login.php and keeps the eye anchored inside the input. */
html[data-apk-theme="dark"] .apk-login-page .apk-password-wrap {
    position: relative !important;
}

html[data-apk-theme="dark"] .apk-login-page .apk-password-toggle,
html[data-apk-theme="dark"] body .apk-login-page .apk-password-toggle {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    display: grid !important;
    place-items: center !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid rgba(147, 197, 253, .26) !important;
    border-radius: 13px !important;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .32) !important;
    z-index: 5 !important;
    pointer-events: auto !important;
    overflow: hidden !important;
}

html[data-apk-theme="dark"] .apk-login-page .apk-password-toggle svg {
    width: 18px !important;
    height: 18px !important;
    color: #ffffff !important;
    fill: currentColor !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-apk-theme="dark"] .apk-login-page .apk-password-wrap input {
    padding-right: 62px !important;
}
