/* Wspólny szablon logowania / rejestracji (enroll + panel) */

.jz-auth-page {
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-card: rgba(255, 255, 255, 0.94);
    --auth-card-border: rgba(255, 255, 255, 0.65);
    --auth-border: #e2e8f0;
    --auth-primary: #0f766e;
    --auth-primary-dark: #115e59;
    --auth-overlay-top: rgba(15, 118, 110, 0.25);
    --auth-overlay-mid: rgba(15, 23, 42, 0.45);
    --auth-overlay-bottom: rgba(15, 23, 42, 0.72);
    --auth-footer-bg: rgba(15, 23, 42, 0.55);
    --auth-footer-text: rgba(248, 250, 252, 0.82);
    --auth-footer-link: rgba(248, 250, 252, 0.92);
    --auth-success: #065f46;
    --auth-success-bg: #d1fae5;
    --auth-error: #991b1b;
    --auth-error-bg: #fee2e2;
}

.jz-auth-page[data-auth-theme="panel"] {
    --auth-primary: #4338ca;
    --auth-primary-dark: #3730a3;
    --auth-overlay-top: rgba(67, 56, 202, 0.28);
    --auth-overlay-mid: rgba(30, 27, 75, 0.52);
    --auth-overlay-bottom: rgba(15, 23, 42, 0.78);
}

* {
    box-sizing: border-box;
}

body.jz-auth-page {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--auth-text);
    line-height: 1.5;
    min-height: 100vh;
}

.jz-auth-shell {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.jz-auth-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background: var(--auth-bg-image) center center / cover no-repeat;
}

.jz-auth-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        var(--auth-overlay-top) 0%,
        var(--auth-overlay-mid) 55%,
        var(--auth-overlay-bottom) 100%
    );
}

.jz-auth-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 1rem;
    gap: 0.75rem;
}

.auth-flash {
    width: min(480px, 100%);
    margin: 0;
}

.jz-auth-footer {
    flex-shrink: 0;
    background: var(--auth-footer-bg);
    border-top: 1px solid rgba(248, 250, 252, 0.12);
    padding: 1.25rem 1rem 1.5rem;
}

.jz-auth-footer-inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
    color: var(--auth-footer-text);
    font-size: 0.875rem;
}

.jz-auth-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem 1rem;
}

.jz-auth-legal a {
    color: var(--auth-footer-link);
    text-decoration: none;
    font-weight: 600;
}

.jz-auth-legal a:hover {
    text-decoration: underline;
}

.jz-auth-brand {
    display: inline-flex;
    line-height: 0;
}

.jz-auth-brand-logo {
    display: block;
    max-width: 180px;
    height: auto;
}

.card {
    background: var(--auth-card);
    border: 1px solid var(--auth-card-border);
    border-radius: 14px;
    padding: 1.35rem 1.5rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(10px);
}

.auth-card {
    width: min(480px, calc(100vw - 2rem));
}

.auth-login-card h1,
.auth-card > h1 {
    margin: 0 0 1.1rem;
    font-size: 1.65rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

label.checkbox-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 500;
}

label.checkbox-row input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    width: 100%;
    font: inherit;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin: 0;
}

.btn,
.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--auth-border);
    background: #fff;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.btn.primary {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
    color: #fff;
}

.btn.primary:hover {
    background: var(--auth-primary-dark);
    border-color: var(--auth-primary-dark);
}

.btn-link {
    border: 0;
    background: transparent;
    color: var(--auth-primary);
    padding: 0;
}

.muted {
    color: var(--auth-muted);
}

.auth-login-form {
    gap: 1rem;
}

.auth-password-block {
    position: relative;
}

.auth-password-block label {
    padding-top: 0;
}

.auth-forgot {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-muted);
    text-decoration: none;
}

.auth-forgot:hover {
    color: var(--auth-primary);
}

.auth-submit {
    width: 100%;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.35rem 0 1rem;
    color: var(--auth-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.65rem 0.5rem;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.9);
    color: var(--auth-text);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
}

.btn-social:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-social:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-social-icon {
    display: flex;
    line-height: 0;
}

.btn-social-logo {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.auth-login-footer {
    margin: 1.15rem 0 0;
    text-align: center;
    font-size: 0.875rem;
}

.auth-register-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 0.875rem;
}

.auth-register-tabs a {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--auth-muted);
    border: 1px solid var(--auth-border);
    background: rgba(255, 255, 255, 0.6);
}

.auth-register-tabs a.active {
    color: #fff;
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-pending-deletion {
    margin-bottom: 1rem;
}

.auth-pending-deletion p {
    margin: 0 0 0.75rem;
}

.auth-pending-deletion-action {
    margin: 0.75rem 0 0;
}

.auth-pending-deletion-action .btn {
    display: inline-flex;
    text-decoration: none;
}

.logged-out-card {
    text-align: center;
}

.field-hint {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
}

.stack > .field-hint.js-password-hint {
    margin-top: 0.15rem;
}

.field-hint-error {
    color: var(--auth-error);
    font-weight: 600;
}

.password-strength {
    margin: 0.35rem 0 0;
    display: grid;
    gap: 0.35rem;
}

.password-strength-track {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.2s ease, background-color 0.2s ease;
    background: #94a3b8;
}

.password-strength-fill[data-level="1"] {
    background: #dc2626;
}

.password-strength-fill[data-level="2"] {
    background: #ea580c;
}

.password-strength-fill[data-level="3"] {
    background: #ca8a04;
}

.password-strength-fill[data-level="4"] {
    background: #16a34a;
}

.password-strength-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-muted);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0;
}

.alert.success {
    background: var(--auth-success-bg);
    color: var(--auth-success);
}

.alert.error {
    background: var(--auth-error-bg);
    color: var(--auth-error);
}

.captcha-wrap {
    min-height: 65px;
}

.recaptcha-legal {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
}

.recaptcha-legal a {
    color: var(--auth-muted);
}

.site-owner-mark {
    display: inline-flex;
    line-height: 0;
    opacity: 0.92;
}

.site-owner-mark:hover {
    opacity: 1;
}

.site-owner-logo {
    display: block;
    max-width: 160px;
    height: auto;
}

@media (max-width: 520px) {
    .auth-social-row {
        grid-template-columns: 1fr;
    }
}
