/* ============================================================
   RS Login Page
   ============================================================ */

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

html, body { height: 100%; }

body.rs-login-body {
    font-family: var(--rs-font);
    background: var(--rs-bg);
    color: var(--rs-text);
    min-height: 100vh;
}

/* ── Layout ─────────────────────────────────────────── */

.rs-login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

@media (max-width: 860px) {
    .rs-login-layout { grid-template-columns: 1fr; }
    /* ukrycie .rs-login-brand — niżej, ZA bazową regułą display:flex
       (ta sama specyficzność: wcześniejsza media query przegrywała i panel
       brandowy renderował się na mobile — odziedziczona pułapka kolejności,
       naprawiona 2026-07-26 przy dostosowaniu do kitu). */
}

/* ── Lewa kolumna — branding ─────────────────────────── */

.rs-login-brand {
    background: var(--rs-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--rs-space-48);
    position: relative;
    overflow: hidden;
}

/* Dekoracyjne kółka w tle */
.rs-login-brand::before,
.rs-login-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
}

.rs-login-brand::before {
    width: 480px;
    height: 480px;
    bottom: -120px;
    left: -100px;
}

.rs-login-brand::after {
    width: 280px;
    height: 280px;
    top: -60px;
    right: -60px;
}

[data-rs-theme="dark"] .rs-login-brand {
    background: #1a2540;
}

.rs-login-brand__inner {
    position: relative;
    z-index: var(--rs-z-raised);
    display: flex;
    flex-direction: column;
    gap: var(--rs-space-32);
}

/* Prawdziwe logo z pakietu marki (2026-07-26, dostosowanie do RS UI Kit) —
   mono-białe na panelu brandowym; tekstowa atrapa „RS" usunięta. */
.rs-login-logo-img {
    display: block;
    width: 250px;
    max-width: 75%;
    height: auto;
}

/* Mobile (<860px): panel brandowy znika — kolorowe logo (to samo co w
   topbarze Shella) nad kartą. */
.rs-login-logo-mobile { display: none; }

@media (max-width: 860px) {
    .rs-login-brand { display: none; }

    .rs-login-logo-mobile {
        display: block;
        width: 190px;
        height: auto;
        margin-bottom: 28px;
    }
}

.rs-login-brand__tagline {
    font-size: var(--rs-text-2xl);
    font-weight: var(--rs-weight-medium);
    color: rgba(255,255,255,.85);
    line-height: var(--rs-leading-normal);
    max-width: 280px;
}

.rs-login-brand__dots {
    display: flex;
    gap: var(--rs-space-8);
}

.rs-login-brand__dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
}

.rs-login-brand__dots span:first-child {
    background: rgba(255,255,255,.9);
    width: 24px;
    border-radius: 4px;
}

/* ── Prawa kolumna ───────────────────────────────────── */

.rs-login-form-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--rs-space-48) var(--rs-space-32);
    background: var(--rs-bg);
}

/* ── Karta formularza ───────────────────────────────── */

.rs-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: var(--rs-radius-xl);
    padding: 36px var(--rs-space-32) 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.rs-login-card__header {
    margin-bottom: 28px;
}

.rs-login-card__title {
    font-size: var(--rs-text-4xl);
    font-weight: var(--rs-weight-bold);
    color: var(--rs-text);
    margin-bottom: var(--rs-space-6);
    letter-spacing: -0.3px;
}

.rs-login-card__sub {
    font-size: var(--rs-text-md);
    color: var(--rs-text-muted);
}

/* ── Alert błędu ─────────────────────────────────────── */

.rs-login-alert {
    display: flex;
    align-items: center;
    gap: var(--rs-space-10);
    padding: var(--rs-space-12) var(--rs-space-14);
    background: var(--rs-red-light);
    border: 1px solid var(--rs-red-mid);
    border-radius: var(--rs-radius-sm);
    color: var(--rs-red);
    font-size: var(--rs-text-base);
    font-weight: var(--rs-weight-medium);
    margin-bottom: var(--rs-space-20);
}

[data-rs-theme="dark"] .rs-login-alert {
    background: rgba(179,56,56,.15);
    border-color: rgba(179,56,56,.3);
    color: #ff7b7b;
}

.rs-login-alert .material-symbols-rounded { font-size: var(--rs-icon-sm); flex-shrink: 0; }

/* ── Pola formularza ─────────────────────────────────── */

.rs-login-form {
    display: flex;
    flex-direction: column;
    gap: var(--rs-space-18);
}

.rs-login-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rs-login-label {
    display: flex;
    align-items: center;
    gap: var(--rs-space-6);
    font-size: var(--rs-text-base);
    font-weight: var(--rs-weight-semibold);
    color: var(--rs-text-muted);
}

.rs-login-label .material-symbols-rounded { font-size: var(--rs-icon-xs); }

.rs-login-input-wrap {
    position: relative;
}

.rs-login-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--rs-space-14);
    border: 1.5px solid var(--rs-border);
    border-radius: var(--rs-radius-sm);
    background: var(--rs-surface);
    color: var(--rs-text);
    font-size: var(--rs-text-md);
    font-family: var(--rs-font);
    transition: border-color var(--rs-transition), box-shadow var(--rs-transition);
    outline: none;
}

.rs-login-input-wrap .rs-login-input {
    padding-right: 44px;
}

.rs-login-input:focus {
    border-color: var(--rs-accent);
    box-shadow: 0 0 0 3px var(--rs-accent-subtle);
}

.rs-login-input::placeholder { color: var(--rs-text-faint); }

.rs-login-passwd-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 44px;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--rs-text-muted);
    cursor: pointer;
    border-radius: 0 var(--rs-radius-sm) var(--rs-radius-sm) 0;
    transition: color var(--rs-transition);
}

.rs-login-passwd-toggle:hover { color: var(--rs-text); }
.rs-login-passwd-toggle .material-symbols-rounded { font-size: var(--rs-icon-sm); }

/* ── Checkbox + forgot ───────────────────────────────── */

.rs-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rs-space-12);
}

.rs-login-checkbox {
    display: flex;
    align-items: center;
    gap: var(--rs-space-8);
    font-size: var(--rs-text-base);
    color: var(--rs-text-muted);
    cursor: pointer;
    user-select: none;
}

.rs-login-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--rs-accent);
    cursor: pointer;
}

.rs-login-forgot {
    font-size: var(--rs-text-base);
    color: var(--rs-accent);
    text-decoration: none;
    font-weight: var(--rs-weight-medium);
    white-space: nowrap;
}

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

/* ── Submit ──────────────────────────────────────────── */

.rs-login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--rs-space-8);
    width: 100%;
    height: 48px;
    background: var(--rs-accent);
    color: var(--rs-on-fill);
    border: none;
    border-radius: var(--rs-radius-md);
    font-size: 15px;
    font-weight: var(--rs-weight-bold);
    font-family: var(--rs-font);
    cursor: pointer;
    transition: opacity var(--rs-transition), transform 100ms;
    margin-top: var(--rs-space-4);
}

.rs-login-submit:hover  { opacity: .88; }
.rs-login-submit:active { transform: scale(.98); }
.rs-login-submit .material-symbols-rounded { font-size: var(--rs-icon-sm); }

/* ── Footer karty ────────────────────────────────────── */

.rs-login-card__footer {
    display: flex;
    justify-content: center;
    margin-top: var(--rs-space-24);
    padding-top: var(--rs-space-20);
    border-top: 1px solid var(--rs-border);
}

.rs-login-theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--rs-space-6);
    font-size: var(--rs-text-sm);
    font-weight: var(--rs-weight-medium);
    color: var(--rs-text-muted);
    background: transparent;
    border: 1px solid var(--rs-border);
    border-radius: var(--rs-radius-xs);
    padding: var(--rs-space-6) var(--rs-space-12);
    cursor: pointer;
    font-family: var(--rs-font);
    transition: background var(--rs-transition), color var(--rs-transition);
}

.rs-login-theme-toggle:hover {
    background: var(--rs-surface-2);
    color: var(--rs-text);
}

.rs-login-theme-toggle .material-symbols-rounded { font-size: 15px; }

/* Pokazuj właściwą ikonę/tekst w zależności od motywu */
[data-rs-theme="light"] .rs-theme-icon--sun,
[data-rs-theme="dark"]  .rs-theme-icon--moon { display: none; }
[data-rs-theme="light"] .rs-theme-icon--moon,
[data-rs-theme="dark"]  .rs-theme-icon--sun  { display: inline-flex; align-items: center; }

/* ── Powered by ──────────────────────────────────────── */

.rs-login-powered {
    margin-top: var(--rs-space-24);
    font-size: var(--rs-text-sm);
    color: var(--rs-text-faint);
    text-align: center;
}


/* ── Fokus klawiatury (2026-07-26, spójność a11y z ekosystemem RS) ──── */
.rs-login-submit:focus-visible,
.rs-login-passwd-toggle:focus-visible,
.rs-login-theme-toggle:focus-visible,
.rs-login-forgot:focus-visible {
    outline: 2px solid var(--rs-accent);
    outline-offset: 2px;
}
