/* BasicSoft web - login page (same layout as the desktop Login form: brand panel + sign-in form) */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: radial-gradient(1200px 600px at 10% -10%, rgba(255, 255, 255, 0.55), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(255, 255, 255, 0.35), transparent 60%), var(--bg);
}

.login-card {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    width: 100%;
    max-width: 980px;
    min-height: 580px;
    background: var(--surface);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* ---------- brand panel ---------- */

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 40px 36px 24px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
    overflow: hidden;
    isolation: isolate;
}

.brand-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    z-index: -1;
}

.brand-circle-a {
    width: 260px;
    height: 260px;
    top: -90px;
    inset-inline-end: -110px;
}

.brand-circle-b {
    width: 200px;
    height: 200px;
    bottom: -70px;
    inset-inline-start: -70px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-size: calc(30px * var(--font-scale, 1));
    font-weight: 700;
    letter-spacing: 0.2px;
}

.brand-subtitle {
    margin-top: 10px;
    font-size: calc(17px * var(--font-scale, 1));
    font-weight: 500;
    opacity: 0.92;
}

.brand-features {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

    .brand-features li {
        position: relative;
        padding-inline-start: 30px;
        font-size: calc(14px * var(--font-scale, 1));
        opacity: 0.92;
    }

        .brand-features li::before {
            content: "";
            position: absolute;
            inset-inline-start: 0;
            top: 2px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: rgba(46, 204, 113, 0.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%232ecc71' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
        }

.brand-chart {
    width: 100%;
    height: 150px;
    margin-top: auto;
    overflow: visible;
}

    .brand-chart .bars rect {
        fill: rgba(255, 255, 255, 0.16);
    }

    .brand-chart .trend {
        fill: none;
        stroke: var(--positive);
        stroke-width: 3;
        stroke-linecap: round;
        stroke-linejoin: round;
        vector-effect: non-scaling-stroke;
        stroke-dasharray: 400;
        stroke-dashoffset: 400;
        animation: draw-trend 1.4s ease-out 0.2s forwards;
    }

    .brand-chart .dots circle {
        fill: #ffffff;
        opacity: 0;
        animation: show-dot 0.3s ease-out 1.3s forwards;
    }

@keyframes draw-trend {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes show-dot {
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-chart .trend {
        animation: none;
        stroke-dashoffset: 0;
    }

    .brand-chart .dots circle {
        animation: none;
        opacity: 1;
    }
}

.brand-foot {
    display: grid;
    gap: 4px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: max(9px, calc(12px * var(--font-scale, 1)));
    opacity: 0.85;
}

.brand-db {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.brand-version {
    font-variant-numeric: tabular-nums;
}

/* ---------- a client's own brand (Helpers/ClientBrands): its logo on a white card, its name, no BasicSoft ---------- */

.brand-panel.is-client {
    gap: 22px;
}

    .brand-panel.is-client::after {
        /* the logo's other colour (the theme's --accent), along the panel's top */
        content: "";
        position: absolute;
        inset-inline: 0;
        top: 0;
        height: 5px;
        background: var(--accent, #f2a20c);
    }

.client-logo-card {
    display: grid;
    place-items: center;
    padding: 22px 20px;
    border-radius: 16px;
    box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.55);
}

    .client-logo-card img {
        display: block;
        width: 100%;
        max-width: 300px;
        height: auto;
    }

.client-name {
    margin: 0;
    font-size: calc(22px * var(--font-scale, 1));
    font-weight: 700;
    line-height: 1.35;
}

.brand-panel.is-client .brand-features li::before {
    /* white ticks on the orange panel */
    background-color: rgba(255, 255, 255, 0.24);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.brand-panel.is-client .brand-foot {
    margin-top: auto;
}

/* ---------- sign-in form ---------- */

.form-panel {
    display: flex;
    flex-direction: column;
    padding: 48px 56px 28px;
}

.login-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.form-title {
    font-size: calc(28px * var(--font-scale, 1));
    font-weight: 700;
    color: var(--text);
}

.form-subtitle {
    margin-top: 4px;
    margin-bottom: 28px;
    color: var(--text-muted);
}

.field {
    margin-bottom: 18px;
}

    .field label {
        display: block;
        margin-bottom: 6px;
        font-size: calc(13px * var(--font-scale, 1));
        font-weight: 600;
        color: var(--text);
    }

.input-wrap {
    position: relative;
}

    .input-wrap input {
        width: 100%;
        height: 48px;
        padding-inline-start: 44px;
        padding-inline-end: 14px;
        border: 1px solid var(--border-strong);
        border-radius: 10px;
        background: var(--surface-muted);
        color: var(--text);
        font: inherit;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    }

        .input-wrap input[type="password"],
        .input-wrap input.is-revealed {
            padding-inline-end: 48px;
        }

        .input-wrap input:hover {
            border-color: var(--primary-hover);
        }

        .input-wrap input:focus {
            outline: none;
            background: var(--surface);
            border-color: var(--primary);
            box-shadow: 0 0 0 4px var(--ring);
        }

.input-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.input-wrap:focus-within .input-icon {
    stroke: var(--primary);
}

.toggle-password {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    width: 34px;
    height: 34px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

    .toggle-password svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: var(--text-muted);
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .toggle-password:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    .toggle-password:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px var(--ring);
    }

    .toggle-password[aria-pressed="true"] svg {
        stroke: var(--primary);
    }

.caps-hint {
    margin-top: 6px;
    font-size: max(9px, calc(12px * var(--font-scale, 1)));
    font-weight: 600;
    color: var(--warning);
}

.form-message {
    min-height: 24px;
    margin-bottom: 14px;
}

    .form-message.is-visible {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
        border: 1px solid var(--danger-border);
        border-radius: 10px;
        background: var(--danger-bg);
        color: var(--danger);
        font-size: calc(14px * var(--font-scale, 1));
        font-weight: 500;
        animation: shake 0.35s ease-in-out;
    }

    .form-message svg {
        flex: none;
        width: 18px;
        height: 18px;
        margin-top: 1px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

@keyframes shake {
    20%, 60% {
        transform: translateX(-4px);
    }

    40%, 80% {
        transform: translateX(4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-message.is-visible {
        animation: none;
    }
}

/* sign in 66% / close 34%, like the desktop buttons */
.form-actions {
    display: grid;
    grid-template-columns: 66fr 34fr;
    gap: 10px;
}

.btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.is-busy .btn-spinner {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* language, theme and font size, at the bottom like the desktop form: the three in one row, each label over its list
   (owner's request), wrapping only on a very narrow phone */
.form-settings {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 28px auto 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.setting {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    margin: 0;
}

    .setting label {
        font-size: calc(13px * var(--font-scale, 1));
        font-weight: 600;
        color: var(--text-muted);
    }

    .setting select {
        width: 100%;
        height: 36px;
        min-width: 0;
        padding: 0 10px;
        border: 1px solid var(--border-strong);
        border-radius: 8px;
        background: var(--surface-muted);
        color: var(--text);
        font: inherit;
        font-size: calc(14px * var(--font-scale, 1));
        cursor: pointer;
    }

        .setting select.setting-narrow {
            min-width: 0;
        }

@media (max-width: 340px) {
    .form-settings {
        flex-wrap: wrap;
    }

    .setting {
        flex-basis: 40%;
    }
}

.setting select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.setting .btn-ghost {
    height: 36px;
    background: var(--primary);
    color: var(--primary-contrast);
}

/* ---------- error page ---------- */

.error-card {
    width: 100%;
    max-width: 460px;
    padding: 36px;
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow);
    text-align: center;
}

/* ---------- small screens: the brand panel becomes a header band ---------- */

@media (max-width: 860px) {
    .login-card {
        grid-template-columns: 1fr;
        min-height: 0;
        max-width: 480px;
    }

    .brand-panel {
        gap: 16px;
        padding: 24px 22px 16px;
    }

    .brand-title {
        font-size: calc(24px * var(--font-scale, 1));
    }

    .brand-subtitle {
        font-size: calc(15px * var(--font-scale, 1));
        margin-top: 6px;
    }

    .brand-features,
    .brand-chart {
        display: none;
    }

    .client-logo-card {
        padding: 14px;
    }

        .client-logo-card img {
            max-width: 220px;
        }

    .client-name {
        font-size: calc(18px * var(--font-scale, 1));
    }

    .form-panel {
        padding: 28px 22px 22px;
    }

    .form-subtitle {
        margin-bottom: 20px;
    }
}

@media (max-width: 380px) {
    .login-shell {
        padding: 0;
        align-items: stretch;
    }

    .login-card {
        border-radius: 0;
    }

    .form-actions {
        grid-template-columns: 1fr;
    }
}
/* the Dark theme (site.css data-theme="6"), under :where() so each rule keeps its light rule's weight: the page's two soft
   lights, dimmed so the dark page does not turn grey */
:where([data-theme="6"]) .login-shell {
    background: radial-gradient(1200px 600px at 10% -10%, rgba(255, 255, 255, 0.06), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(255, 255, 255, 0.04), transparent 60%), var(--bg);
}
