/* ===== Login — liquid glass (glassmorphism) ===== */

html:has(body.login-body),
body.login-body {
    height: 100%;
    min-height: 100vh;
}

.login-body {
    position: relative;
    overflow-x: hidden;
    background-color: #0a0c24;
}

/* Tło — skalowane do viewportu użytkownika */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #0a0c24;
    background-image: url('../images/login-bg.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    pointer-events: none;
}

.login-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* --- Karta: asymetryczny kształt + liquid glass --- */
.login-card {
    position: relative;
    border-radius: 70px 10px 70px 10px;
    padding: 2.5rem 2.25rem 2.25rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.login-card-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 20px rgba(0, 0, 0, 0.18);
}

/* Własne logo (np. szerokie) — ramka dopasowana do szerokości obrazka */
.brand-logo:has(> img) {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    height: auto;
    min-height: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 18px;
    overflow: visible;
}

.brand-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(280px, 100%);
    max-height: 72px;
    object-fit: contain;
    object-position: center;
}

.brand-logo svg {
    width: 36px;
    height: 36px;
    stroke: #fff;
    fill: none;
    flex-shrink: 0;
}

.login-form-error {
    margin-bottom: 0.75rem;
}

/* --- Pola formularza (szkło) --- */
.local-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    min-height: 48px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input-wrap:focus-within {
    border-color: rgba(255, 255, 255, 0.38);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

.field-input-icon {
    position: absolute;
    right: 1rem;
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.65);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.field-input-icon svg {
    width: 18px;
    height: 18px;
}

.field input {
    width: 100%;
    padding: 0.75rem 2rem 0.75rem 0;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #fff;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.field input::placeholder {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8125rem;
}

.field input:focus {
    outline: none;
    box-shadow: none;
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    transition: background-color 9999s ease-out 0s;
    -webkit-box-shadow: 0 0 0 1000px transparent inset;
    box-shadow: 0 0 0 1000px transparent inset;
}

/* --- Przyciski szkła (Microsoft + Zaloguj — ten sam styl) --- */
.login-btn-glass {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 1.5rem;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.login-btn-glass:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.login-btn-glass:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.12);
}

.local-form .btn-login {
    margin-top: 1.25rem;
}

.btn-microsoft {
    gap: 0.625rem;
}

.btn-microsoft-logo,
.btn-microsoft-logo-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.15rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
}

.divider span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

.login-body .btn-local-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.login-body .btn-local-toggle:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.24);
    color: #fff;
}

.btn-local-toggle .chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.btn-local-toggle.open .chevron {
    transform: rotate(180deg);
}

.local-form {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
}

.local-form.visible {
    max-height: 380px;
    opacity: 1;
    overflow: visible;
    padding-top: 1rem;
}

.deactivated-notice {
    text-align: center;
    color: #fde68a;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    padding: 0.5rem 0 1.25rem;
}

.login-body .btn-logout {
    display: flex;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    text-decoration: none;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.login-body .btn-logout:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .login-card,
    .login-btn-glass,
    .field-input-wrap {
        background: rgba(22, 20, 52, 0.82);
    }
}

@media (max-width: 640px) {
    .login-card {
        padding: 2rem 1.5rem 1.75rem;
        border-radius: 52px 8px 52px 8px;
    }

    .brand-logo:not(:has(> img)) {
        width: 76px;
        height: 76px;
    }

    .brand-logo:has(> img) {
        padding: 0.45rem 0.65rem;
    }

    .brand-logo img {
        max-width: min(240px, 100%);
        max-height: 56px;
    }

    .brand-logo svg {
        width: 32px;
        height: 32px;
    }
}
