/* sbwz-matrika app-specific styles — complements sbwz-tokens.css (the shared, unmodified
   design system file). Keeps sbwz-tokens.css copy-pasteable across SBwZ micro-services while
   this app's own form-field styling lives here, matching the design system's documented
   "Forms" spec exactly (input height 40px, border 1.5px solid --border, focus/error states,
   13px Barlow 600 label). */

.field {
    display: block;
    width: 100%;
    height: 40px;
    margin-bottom: 8px;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--input-bg, var(--surface));
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
}

.field:focus {
    outline: none;
    border-color: var(--navy-500, var(--accent));
    box-shadow: 0 0 0 3px rgba(30, 61, 114, 0.10);
}

label.field-label {
    display: block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* htmx request indicator — shown only while a request this element triggered is in flight. */
.htmx-indicator {
    opacity: 0;
    transition: opacity 150ms ease-in;
    color: var(--text-muted);
    font-size: 13px;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Phase 2 htmx: shared panel (#modal) + toast (#toast) infrastructure — see
   docs/superpowers/specs/2026-09-15-htmx-phase2-design.md §2.1/2.2. The form-opening fragment
   returned to #modal renders both of the rules below as one backdrop+card block; #toast gets an
   out-of-band swap on any successful action. */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 28, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}

/* Fades itself out with a pure CSS animation (no setTimeout/JS) and never intercepts a click,
   even while visible, since it's an ephemeral status message, not an interactive element. */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-on-accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
    z-index: 1100;
    pointer-events: none;
    animation: toast-fade 4s ease-in forwards;
}

.toast-ok {
    background: var(--navy-700);
}

.toast-error {
    background: var(--accent);
}

@keyframes toast-fade {
    0%   { opacity: 0; transform: translate(-50%, 8px); }
    8%   { opacity: 1; transform: translate(-50%, 0); }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}

/* Login page redesign — 50/50 split-panel layout with centered card, silhouette watermark, and footer */
.login-viewport {
    position: relative;
    display: flex;
    min-height: 100vh;
}

/* Exact 50/50 split */
.login-panel {
    flex: 0 0 50%;
    position: relative;
    overflow: hidden;
    background: #254aa5;
    color: #fff;
}

.login-panel::before {
    content: "";
    position: absolute;
    inset: 20%;
    background: url(/assets/sbwz-silhouette.png) center/contain no-repeat;
    opacity: .02;
}

.login-content {
    flex: 0 0 50%;
    background: #fff;
    position: relative;
}

.login-panel-brand {
    z-index: 1;
    position: absolute;
    top: 50%;
    left: 6%;
    max-width: calc(50vw - 190px - 6vw - 24px);
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 22px;
}

.login-panel-name {
    font-family: var(--font-display, system-ui);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: .01em;
}

.login-panel-name b {
    display: block;
    font-size: 44px;
}

.login-panel-name span {
    display: block;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-top: 8px;
    opacity: .92;
}

/* Card centred exactly on the split line */
.login-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-width: calc(100% - 32px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .14);
    padding: 64px 32px 36px;
}

.login-badge {
    position: absolute;
    top: -34px;
    left: 50%;
    transform: translateX(-50%);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-badge img {
    width: 74px;
    height: 74px;
    border-radius: 50%;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    text-align: center;
    color: #44403c;
}

.subtitle {
    text-align: center;
    color: #78716c;
    font-size: 14px;
    margin: 0 0 28px;
}

.login-card label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #57534e;
    margin-bottom: 6px;
}

.login-password-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.login-password-row label {
    margin-bottom: 0;
}

.login-forgot {
    font-size: 13px;
    color: #254aa5;
    text-decoration: none;
}

.login-forgot:hover {
    text-decoration: underline;
}

.login-card input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d6d3d1;
    border-radius: 6px;
    background: #fafaf9;
    margin-bottom: 18px;
    font-size: 14px;
}

.login-card input:focus {
    outline: none;
    border-color: #254aa5;
    box-shadow: 0 0 0 3px rgba(37, 74, 165, 0.1);
}

.login-submit {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 6px;
    background: var(--accent, #c8102e);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: 12px;
    cursor: pointer;
}

.login-submit:hover {
    opacity: 0.9;
}

.login-error,
.login-success {
    color: var(--accent, #c8102e);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

.login-success {
    color: #059669;
}

.foot-left,
.foot-right {
    position: absolute;
    bottom: 14px;
    font-size: 12px;
}

.foot-left {
    left: 16px;
    color: #fff;
    opacity: .9;
}

.foot-left a {
    color: #fff;
    text-decoration: none;
}

.foot-left a:hover {
    text-decoration: underline;
}

.foot-right {
    right: 16px;
    color: #78716c;
    text-align: right;
}

/* Responsive: mobile layout (<=900px) */
@media (max-width: 900px) {
    .login-viewport {
        flex-direction: column;
    }

    .login-panel {
        flex: 0 0 220px;
    }

    .login-content {
        flex: 1;
    }

    .login-panel-brand {
        left: 20px;
        top: 28px;
        transform: none;
        gap: 14px;
        max-width: none;
        right: 20px;
    }

    .login-panel-name b {
        font-size: 22px;
    }

    .login-panel-name span {
        font-size: 11px;
    }

    .login-card {
        top: 270px;
        transform: translateX(-50%);
    }

    .foot-left {
        display: none;
    }

    .foot-right {
        position: static;
        padding: 560px 16px 16px;
        text-align: center;
    }
}
