/* =========================================================
   QuNu ERP — LOGIN
   Matches QuNu ERP Admin Theme
========================================================= */

:root {

    --primary: #635bff;
    --primary-dark: #5148e5;
    --primary-soft: rgba(99, 91, 255, .12);

    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, .12);

    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, .12);

    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;

    --sidebar: #111827;

    --text: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --border: #e5e7eb;
    --border-light: #eef0f4;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, .05);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .14);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --transition: .25s ease;
}


[data-theme="dark"] {

    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #172033;
    --surface-3: #202b3e;
    /* --h1: var(--text-secondary); */
    --text: #f3f4f6;
    --text-secondary: #aab3c2;
    --text-muted: #718096;

    --border: #263247;
    --border-light: #1d293d;

    --sidebar: #080d18;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .18);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .35);
}


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100vh;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    /* min-height: 100vh; */
    overflow-x: hidden;
    transition:
        background .3s ease,
        color .3s ease;
}

button,
input {
    font: inherit;
}

button {
    border: none;
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}


/* =========================================================
   PAGE
========================================================= */

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    position: relative;
    z-index: 1;
}


/* =========================================================
   BACKGROUND
========================================================= */

.background-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .35;

    background-image:
        linear-gradient(rgba(99, 91, 255, .035) 1px,
            transparent 1px),
        linear-gradient(90deg,
            rgba(99, 91, 255, .035) 1px,
            transparent 1px);

    background-size: 42px 42px;

    mask-image:
        linear-gradient(to bottom,
            black,
            transparent 85%);
}

.glow {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
    opacity: .09;
}

.glow-one {
    background: var(--primary);
    top: -250px;
    left: -150px;
}

.glow-two {
    background: #8b5cf6;
    right: -250px;
    bottom: -300px;
}


/* =========================================================
   BRAND PANEL
========================================================= */

.brand-panel {
    min-height: 100vh;
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        radial-gradient(circle at 15% 15%,
            rgba(99, 91, 255, .16),
            transparent 32%),
        radial-gradient(circle at 85% 85%,
            rgba(139, 92, 246, .10),
            transparent 35%);
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255, 255, 255, .04);
    border-radius: 50%;
    right: -210px;
    top: 50%;
    transform: translateY(-50%);
}


.brand-content {
    min-height: 100vh;
    padding: 25px 50px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}


/* =========================================================
   BRAND HEADER
========================================================= */

.brand-header {
    display: flex;
    align-items: center;
}

.brand-mark {
    width: 42px;
    height: 42px;

    border-radius: 11px;

    background:
        linear-gradient(135deg,
            #756cff,
            #4f46e5);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
    font-weight: 800;

    box-shadow:
        0 8px 20px rgba(99, 91, 255, .30);

    flex-shrink: 0;
}

.brand-name {
    margin-left: 12px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.3px;
}

.brand-subtitle {
    margin-left: 12px;
    margin-top: 3px;
    color: #7f8b9d;
    font-size: 9px;
}


/* =========================================================
   BRAND MAIN
========================================================= */

.brand-main {
    margin: auto 0;
    max-width: 510px;
    /* padding: 80px 0; */
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: #8d99aa;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--primary);

    box-shadow:
        0 0 0 4px rgba(99, 91, 255, .12);
}

.brand-main h1 {
    margin-top: 18px;

    font-size: clamp(38px, 4vw, 58px);
    line-height: 1.05;

    font-weight: 800;
    letter-spacing: -2.5px;
}

.brand-main h1 span {
    display: block;
    color: var(--primary);
}

.brand-main>p {
    max-width: 470px;
    margin-top: 22px;

    color: #8e9aab;

    font-size: 13px;
    line-height: 1.75;
}


/* =========================================================
   FEATURES
========================================================= */

.feature-list {
    margin-top: 38px;

    /* display: flex; */
    display: none;
    flex-direction: column;
    gap: 13px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 13px;

    padding: 11px 12px;

    width: fit-content;
    min-width: 300px;

    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 11px;

    background: rgba(255, 255, 255, .025);

    transition:
        transform .25s ease,
        background .25s ease,
        border-color .25s ease;
}

.feature:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, .045);
    border-color: rgba(99, 91, 255, .25);
}

.feature-icon {
    width: 34px;
    height: 34px;

    border-radius: 9px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #8c85ff;
    background: rgba(99, 91, 255, .12);

    font-size: 13px;
}

.feature strong {
    display: block;

    font-size: 10px;
    font-weight: 700;

    color: #dce1e9;
}

.feature small {
    display: block;

    margin-top: 3px;

    color: #707d90;

    font-size: 8px;
}


/* =========================================================
   BRAND FOOTER
========================================================= */

.brand-footer {
    display: flex;
    align-items: center;
    gap: 12px;

    color: #687588;

    font-size: 8px;
}

.brand-footer i {
    margin-right: 5px;
    color: #22c55e;
}

.footer-separator {
    width: 3px;
    height: 3px;

    border-radius: 50%;
    background: #4b5563;
}


/* =========================================================
   LOGIN PANEL
========================================================= */

.login-panel {
    min-height: 100vh;

    background: var(--bg);

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
}

.login-container {
    width: 100%;
    max-width: 460px;
    min-height: 100vh;

    padding: 34px 45px;

    display: flex;
    flex-direction: column;
}


/* =========================================================
   TOPBAR
========================================================= */

.login-topbar {
    display: flex;
    justify-content: flex-end;
}

.theme-toggle {
    width: 38px;
    height: 38px;

    border-radius: 9px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--surface);
    border: 1px solid var(--border);

    color: var(--text-secondary);

    transition: .2s;
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--surface-2);
    transform: translateY(-1px);
}


/* =========================================================
   MOBILE BRAND
========================================================= */

.mobile-brand {
    display: none;
}


/* =========================================================
   LOGIN CONTENT
========================================================= */

.login-content {
    width: 100%;
    margin: auto 0;
}

.login-heading {
    margin-bottom: 29px;
}


.login-heading h2 {
    margin-top: 10px;

    color: var(--text);

    font-size: 27px;
    font-weight: 800;

    letter-spacing: -.8px;
}

.login-heading p {
    margin-top: 7px;

    color: var(--text-secondary);

    font-size: 11px;
    line-height: 1.6;
}


/* =========================================================
   FORM
========================================================= */

.form-group {
    margin-bottom: 19px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: var(--text);
    font-size: 10px;
    font-weight: 700;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 8px;
}

.label-row label {
    margin-bottom: 0;
}

.label-row a {
    color: var(--primary);

    font-size: 9px;
    font-weight: 600;
}

.label-row a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}


/* =========================================================
   INPUTS
========================================================= */

.input-wrapper {
    height: 45px;

    display: flex;
    align-items: center;

    position: relative;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);

    transition:
        border-color .2s,
        box-shadow .2s,
        background .2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px var(--primary-soft);
}

.input-icon {
    width: 43px;

    text-align: center;

    color: var(--text-muted);

    font-size: 13px;
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.input-wrapper input {
    flex: 1;

    height: 100%;

    min-width: 0;

    padding: 0 10px 0 0;

    border: none;
    outline: none;

    background: transparent;

    color: var(--text);

    font-size: 11px;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    width: 42px;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;

    color: var(--text-muted);

    font-size: 12px;

    transition: .2s;
}

.password-toggle:hover {
    color: var(--text);
}


/* =========================================================
   ERROR
========================================================= */

.field-error {
    display: block;

    min-height: 0;

    margin-top: 5px;

    color: var(--danger);

    font-size: 8px;
}


/* =========================================================
   REMEMBER
========================================================= */

.form-options {
    margin-top: -2px;
    margin-bottom: 20px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--text-secondary);

    font-size: 9px;

    cursor: pointer;
}

.remember input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.custom-checkbox {
    width: 15px;
    height: 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 4px;

    background: var(--surface);

    color: white;

    font-size: 8px;

    transition: .2s;
}

.remember input:checked+.custom-checkbox {
    border-color: var(--primary);
    background: var(--primary);
}


/* =========================================================
   LOGIN BUTTON
========================================================= */

.login-button {
    width: 100%;
    height: 45px;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--primary);
    color: white;

    font-size: 11px;
    font-weight: 700;

    box-shadow:
        0 7px 18px rgba(99, 91, 255, .22);

    transition:
        background .2s,
        transform .2s,
        box-shadow .2s;
}

.login-button:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);

    box-shadow:
        0 10px 23px rgba(99, 91, 255, .27);
}

.login-button:active {
    transform: translateY(0);
}

.button-arrow {
    position: absolute;
    right: 15px;

    font-size: 10px;

    transition: transform .2s;
}

.login-button:hover .button-arrow {
    transform: translateX(3px);
}

.button-loader {
    display: none;
}

.login-button.loading .button-text,
.login-button.loading .button-arrow {
    display: none;
}

.login-button.loading .button-loader {
    display: block;
}


/* =========================================================
   LOGIN MESSAGE
========================================================= */

.login-message {
    display: none;

    margin-top: 12px;
    padding: 10px 12px;

    border-radius: 8px;

    font-size: 9px;
    line-height: 1.5;
}

.login-message.show {
    display: block;
}

.login-message.error {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(239, 68, 68, .16);
}

.login-message.success {
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid rgba(22, 163, 74, .16);
}


/* =========================================================
   DIVIDER
========================================================= */

.divider {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 27px 0 20px;
}

.divider span {
    height: 1px;
    flex: 1;

    background: var(--border);
}

.divider small {
    color: var(--text-muted);

    font-size: 7px;
    font-weight: 700;

    letter-spacing: 1px;
}


/* =========================================================
   SECURITY
========================================================= */

.security-note {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 11px 12px;

    border: 1px solid var(--border-light);
    border-radius: 10px;

    background: var(--surface-2);
}

.security-icon {
    width: 29px;
    height: 29px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    color: var(--success);
    background: var(--success-soft);

    font-size: 11px;
}

.security-note strong {
    display: block;

    color: var(--text);

    font-size: 9px;
    font-weight: 700;
}

.security-note span {
    display: block;

    margin-top: 3px;

    color: var(--text-muted);

    font-size: 7px;
}


/* =========================================================
   FOOTER
========================================================= */

.login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    color: var(--text-muted);

    font-size: 8px;
}

.login-footer a {
    color: var(--primary);
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

.version {
    opacity: .7;
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes loginFade {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}

.login-content {
    animation: loginFade .5s ease;
}

.brand-main {
    animation: loginFade .6s ease;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

    .login-page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
    }

    .login-container {
        max-width: 460px;
        padding: 25px 30px;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
    }

}


@media (max-width: 600px) {

    .login-panel {
        align-items: flex-start;
    }

    .login-container {
        min-height: 100vh;
        padding: 20px;
    }

    .login-topbar {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    .mobile-brand {
        margin-top: 5px;
        margin-bottom: 65px;
    }

    .login-heading h2 {
        font-size: 24px;
    }

    .login-heading {
        margin-bottom: 25px;
    }

    .login-content {
        margin: 0;
    }

    .login-footer {
        margin-top: 35px;
    }

}


@media (max-width: 380px) {

    .login-container {
        padding: 18px;
    }

    .mobile-brand {
        margin-bottom: 50px;
    }

    .login-heading h2 {
        font-size: 22px;
    }

    .input-wrapper,
    .login-button {
        height: 44px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }

}

.mobile-brand {
    display: none !important;
}