/* ============================================================================
 * Netstripes login theme. Project tweak slot.
 * ----------------------------------------------------------------------------
 * Loaded after bizbms/css/login.css by the framework shell
 * (bizbms/templates/wagtailadmin/login.html), so these rules win by order /
 * specificity without forking the framework file. Plain CSS only (no Tailwind
 * theme() — this file is served directly, not run through PostCSS).
 *
 * Re-skins the framework's blue/purple Wagtail login to the Netstripes design
 * in Downloads/netstripes-login.html: teal palette, Playfair Display display
 * face, DM Sans body, brand gradient panel with feature cards (left), and a
 * "Netstripes Admin" form card with a solid teal arrow button (right). The
 * project owns header/footer/form/project_panel partials; BizBMS branding and
 * the theme toggle are dropped, so the screen is forced dark regardless of the
 * framework's pre-paint theme detection (see "Force dark" at the bottom).
 * ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
    --ns-teal: #1a7a7a;
    --ns-teal-brand: #76c9be;
    --ns-teal-light: #228f8f;
    --ns-surface: #152424;
    --ns-input-bg: #0c1515;
    --ns-border: rgba(118, 201, 190, 0.25);
    --ns-border-input: rgba(118, 201, 190, 0.2);
    --ns-card-bg: rgba(118, 201, 190, 0.04);
    --ns-card-border: rgba(118, 201, 190, 0.1);
    --ns-ghost: rgba(118, 201, 190, 0.06);
    --ns-text: #e8efef;
    --ns-text-muted: #8aa3a3;
    --ns-text-dim: rgba(138, 163, 163, 0.5);
    --ns-page: #0d1e1e;
    --ns-page-bg:
        radial-gradient(ellipse 90% 70% at 100% 100%, rgba(118, 201, 190, 0.16), transparent 60%),
        radial-gradient(ellipse 50% 40% at 0% 0%, rgba(26, 122, 122, 0.12), transparent 50%),
        #0d1e1e;
    --ns-brand-bg:
        radial-gradient(circle 520px at 100% 0%, rgba(118, 201, 190, 0.06), transparent 70%),
        linear-gradient(165deg, #0d1e1e 0%, #132a2a 40%, #1a3838 100%);
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, system-ui, sans-serif;
}

/* ---------------------------------------------------------------------------
   Page background + body font.
   --------------------------------------------------------------------------- */

body.login {
    background: var(--ns-page) !important;
    color: var(--ns-text);
    font-family: var(--font-body);
}

.bms-login {
    background: var(--ns-page-bg);
}

/* ---------------------------------------------------------------------------
   Left brand panel. The shell wraps project_panel.html in a card section
   (bg-white/[0.04] border rounded-3xl overflow-hidden). Re-skin that section
   into the Netstripes brand gradient; content lives in .ns-brand.
   --------------------------------------------------------------------------- */

.bms-login section:not(.bms-login-form-card) {
    position: relative;
    background: var(--ns-brand-bg) !important;
    border-color: var(--ns-card-border) !important;
}

.ns-brand {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 34px;
    width: 100%;
    text-align: center;
}

.ns-grid-pattern {
    position: absolute;
    inset: -28px;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(118, 201, 190, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(118, 201, 190, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

.ns-brand > *:not(.ns-grid-pattern) {
    position: relative;
    z-index: 1;
}

.ns-logo {
    height: 30px;
    width: auto;
}

.ns-brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 460px;
}

.ns-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--ns-card-border);
    background: var(--ns-ghost);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ns-teal-brand);
}

.ns-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ns-teal-brand);
    box-shadow: 0 0 12px var(--ns-teal-brand);
}

.ns-headline {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--ns-text);
}

.ns-headline em {
    font-style: italic;
    color: var(--ns-teal-brand);
}

.ns-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ns-text-muted);
}

/* Feature cards */

.ns-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    text-align: left;
}

.ns-feature-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--ns-card-bg);
    border: 1px solid var(--ns-card-border);
    transition: background 0.2s, border-color 0.2s;
}

.ns-feature-card:hover {
    background: rgba(118, 201, 190, 0.07);
    border-color: rgba(118, 201, 190, 0.18);
}

.ns-feature-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--ns-ghost);
    border: 1px solid var(--ns-card-border);
    color: var(--ns-teal-brand);
}

.ns-feature-icon svg {
    width: 16px;
    height: 16px;
}

.ns-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ns-feature-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ns-text);
}

.ns-feature-desc {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--ns-text-muted);
}

/* ---------------------------------------------------------------------------
   Right form card. Project owns form.html; supply all layout here since the
   framework's Tailwind utility classes were dropped from the section.
   --------------------------------------------------------------------------- */

.bms-login-form-card.ns-form-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 44px;
    border-radius: 24px;
    background: var(--ns-surface) !important;
    border: 1px solid var(--ns-border) !important;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

.ns-login-header {
    margin-bottom: 36px;
}

.ns-accent-line {
    display: block;
    width: 48px;
    height: 3px;
    margin-bottom: 20px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--ns-teal-brand), transparent);
}

.ns-welcome {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--ns-text-muted);
}

.ns-form-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--ns-text);
}

.ns-form-title span {
    color: var(--ns-teal-brand);
}

.ns-form-sub {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--ns-text-muted);
}

.ns-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 0;
}

/* Wagtail-rendered fields: keep the framework's dark base, retint to teal. */

.bms-login-form-card .login-form label {
    color: var(--ns-text-muted);
    font-weight: 500;
    font-size: 13px;
}

.bms-login-form-card .login-form input[type="text"],
.bms-login-form-card .login-form input[type="email"],
.bms-login-form-card .login-form input[type="password"] {
    background: var(--ns-input-bg) !important;
    border: 1px solid var(--ns-border-input) !important;
    border-radius: 8px !important;
    padding: 14px 16px !important;
    color: var(--ns-text) !important;
}

.bms-login-form-card .login-form input[type="text"]::placeholder,
.bms-login-form-card .login-form input[type="email"]::placeholder,
.bms-login-form-card .login-form input[type="password"]::placeholder {
    color: rgba(138, 163, 163, 0.35);
}

.bms-login-form-card .login-form input[type="text"]:focus,
.bms-login-form-card .login-form input[type="email"]:focus,
.bms-login-form-card .login-form input[type="password"]:focus {
    border-color: var(--ns-teal-brand) !important;
    background: #0e1818 !important;
    box-shadow: 0 0 0 3px rgba(118, 201, 190, 0.18);
}

.bms-login-form-card .login-form input[type="checkbox"] {
    accent-color: var(--ns-teal);
}

.ns-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ns-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--ns-text-muted);
    cursor: pointer;
}

.ns-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ns-teal);
    cursor: pointer;
}

.ns-forgot {
    font-size: 13px;
    color: var(--ns-teal-brand);
    text-decoration: none;
}

.ns-forgot:hover {
    color: #9edbd2;
    text-decoration: underline;
}

/* Solid teal submit button with dark text + arrow. Keeps Wagtail's
   button-longrunning behaviour (spinner shown only when -active). */

.bms-login-form-card .ns-login-btn {
    width: 100%;
    margin-top: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none !important;
    border-radius: 8px;
    background: var(--ns-teal-brand) !important;
    color: #0f1a1a !important;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.bms-login-form-card .ns-login-btn:hover {
    background: #8dd4ca !important;
    box-shadow: 0 4px 24px rgba(118, 201, 190, 0.25);
}

.bms-login-form-card .ns-login-btn:active {
    transform: scale(0.985);
}

.ns-btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.bms-login-form-card .ns-login-btn:hover .ns-btn-arrow {
    transform: translateX(3px);
}

/* Hide the arrow while the long-running spinner is active. */
.button-longrunning-active .ns-btn-arrow {
    display: none;
}

.ns-form-footer {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(118, 201, 190, 0.08);
}

.ns-form-footer p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: var(--ns-text-dim);
}

.ns-form-footer a {
    color: var(--ns-teal-brand);
    text-decoration: none;
    opacity: 0.85;
}

.ns-form-footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Responsive. The shell stacks the columns at lg; tighten paddings below it.
   --------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .bms-login-form-card.ns-form-card {
        padding: 36px 28px;
    }

    .ns-brand {
        gap: 26px;
    }
}

/* ============================================================================
 * Force dark.
 * ----------------------------------------------------------------------------
 * The theme toggle is removed, but the framework's pre-paint script still sets
 * html[data-bms-login-theme="light"] for users whose OS prefers light. Those
 * framework light rules out-specify the defaults above for a few shared
 * surfaces (page, form card, Wagtail inputs, labels, messages). Re-assert the
 * dark Netstripes values at matching-or-higher specificity so the screen stays
 * dark in both themes. The brand-panel surface already uses !important above
 * against a non-!important framework rule, so it needs no counter here.
 * ========================================================================== */

html[data-bms-login-theme="light"] body.login {
    background: var(--ns-page) !important;
    color: var(--ns-text);
}

html[data-bms-login-theme="light"] .bms-login {
    background: var(--ns-page-bg);
}

/* Framework light tints the form card white at (0,2,1)!important, out-specifying
   the .ns-form-card rule above. Match it with the extra .ns-form-card class. */
html[data-bms-login-theme="light"] .bms-login-form-card.ns-form-card {
    background: var(--ns-surface) !important;
    border-color: var(--ns-border) !important;
}

html[data-bms-login-theme="light"] .bms-login-form-card .login-form label {
    color: var(--ns-text-muted);
}

html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="text"],
html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="email"],
html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="password"] {
    background: var(--ns-input-bg) !important;
    border-color: var(--ns-border-input) !important;
    color: var(--ns-text) !important;
}

html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="text"]::placeholder,
html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="email"]::placeholder,
html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="password"]::placeholder {
    color: rgba(138, 163, 163, 0.35);
}

html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="text"]:focus,
html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="email"]:focus,
html[data-bms-login-theme="light"] .bms-login-form-card .login-form input[type="password"]:focus {
    background: #0e1818 !important;
    box-shadow: 0 0 0 3px rgba(118, 201, 190, 0.18);
}

html[data-bms-login-theme="light"] .bms-login-form-card .messages li {
    background: rgba(232, 93, 93, 0.12);
    border-color: rgba(232, 93, 93, 0.3);
    color: #fecaca;
}
