/* static/inventory/css/login.css */
/* Storly login page - conversion-first, matched to new login.html */

:root {
    --ink: #0f172a;
    --ink-soft: #1e293b;
    --muted: #64748b;
    --soft: #94a3b8;

    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --purple: #7c3aed;

    --success: #047857;
    --success-soft: #ecfdf5;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --info: #1d4ed8;
    --info-soft: #eff6ff;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #f1f5f9;

    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 24px 70px rgba(15, 23, 42, 0.10);

    --radius-lg: 28px;
    --radius-xl: 34px;

    --shell-max: 1180px;
    --form-width: 470px;
}

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

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

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    color: var(--ink);
    background: #f4f7fb;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* PAGE */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: var(--shell-max);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, var(--form-width));
    gap: 18px;
    align-items: stretch;
}

/* LEFT VISUAL */

.login-visual {
    position: relative;
    min-height: 720px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background-color: #0b1120;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-md);
    color: #ffffff;
}

.login-visual-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 14%, rgba(37, 99, 235, 0.14), transparent 24%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.52));
}

.login-visual-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.login-visual-brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.login-brand-logo {
    width: 152px;
    height: auto;
}

.login-brand-logo-light {
    filter: none;
}

.login-visual-copy {
    max-width: 420px;
    padding: 18px 18px 0 0;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.visual-eyebrow {
    color: rgba(255, 255, 255, 0.86);
}

.login-visual-copy h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(30px, 3.6vw, 44px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.06em;
}

.login-visual-copy > p:last-of-type {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
    line-height: 1.65;
    font-weight: 600;
}

.login-visual-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.login-visual-proof span {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.94);
    font-size: 12px;
    font-weight: 800;
}

/* RIGHT CARD */

.login-card-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card {
    position: relative;
    width: 100%;
    min-height: 720px;
    padding: 26px 26px 22px;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.96);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: linear-gradient(90deg, var(--blue), var(--purple));
}

.login-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.login-mobile-brand {
    display: none;
    align-items: center;
}

.login-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 15px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 800;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.login-secondary-link:hover {
    background: #ffffff;
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.login-card-header {
    margin-bottom: 14px;
}

.login-card-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: 34px;
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: -0.07em;
}

.login-card-header p:last-child {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.login-proof-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.login-proof-row span {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 800;
}

/* MESSAGES */

.login-messages {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.login-message {
    padding: 13px 15px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
}

.login-message a {
    color: inherit;
    font-weight: 900;
    text-decoration: underline;
}

.login-message.info {
    background: var(--info-soft);
    color: var(--info);
    border: 1px solid #bfdbfe;
}

.login-message.success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

.login-message.error,
.login-message.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.login-message.warning {
    background: var(--warning-soft);
    color: var(--warning);
    border: 1px solid #fde68a;
}

/* FORM */

.login-form {
    display: grid;
    gap: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 900;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.form-label-row label {
    margin-bottom: 0;
}

.forgot-password-link {
    color: var(--blue);
    font-size: 12.5px;
    font-weight: 900;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.form-group input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #dbe3ef;
    background: #ffffff;
    color: var(--ink);
    font-size: 14px;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.form-group input::placeholder {
    color: #a7b2c3;
}

.form-group input:hover {
    border-color: #cbd5e1;
}

.form-group input:focus {
    border-color: var(--blue);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.12),
        0 10px 24px rgba(15, 23, 42, 0.05);
    background: #ffffff;
}

.form-group.has-error input,
.form-group.has-error .password-wrap input {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.field-error {
    display: none;
    margin-top: 8px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}

.field-error.is-visible {
    display: block;
}

/* PASSWORD */

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 78px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    padding: 6px 8px;
}

.password-toggle:hover {
    color: var(--blue-dark);
}

/* CTA */

.login-button {
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    border: 0;
    border-radius: 18px;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    font-size: 15px;
    font-weight: 950;
    box-shadow:
        0 18px 38px rgba(37, 99, 235, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        filter 0.16s ease,
        opacity 0.16s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    filter: saturate(1.06);
    box-shadow:
        0 22px 50px rgba(37, 99, 235, 0.34),
        0 10px 22px rgba(124, 58, 237, 0.16);
}

.login-button:disabled {
    opacity: 0.76;
    cursor: not-allowed;
    transform: none;
}

.login-inline-note {
    padding: 11px 13px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 700;
}

/* FOOTER */

.login-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e7edf5;
    display: grid;
    gap: 5px;
    text-align: center;
}

.login-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.login-footer a {
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* RESPONSIVE */

@media (max-width: 980px) {
    .login-shell {
        max-width: 560px;
        grid-template-columns: 1fr;
    }

    .login-visual {
        display: none;
    }

    .login-card {
        min-height: auto;
        padding: 24px 20px 20px;
        box-shadow: var(--shadow-sm);
    }

    .login-mobile-brand {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .login-page {
        padding: 12px;
    }

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

    .login-topbar {
        margin-bottom: 12px;
    }

    .login-brand-logo {
        width: 138px;
    }

    .login-card-header h2 {
        font-size: 28px;
        line-height: 1;
        letter-spacing: -0.055em;
    }

    .login-card-header p:last-child {
        font-size: 13px;
        line-height: 1.5;
    }

    .login-form {
        gap: 12px;
    }

    .form-group input {
        min-height: 50px;
        padding: 12px 14px;
        border-radius: 15px;
        font-size: 16px;
    }

    .login-proof-row {
        justify-content: center;
    }
}

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

    .login-card {
        min-height: calc(100vh - 20px);
        border-radius: 22px;
    }

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

    .login-card-header h2 {
        font-size: 26px;
    }
}