/*
 * Login framework6.1 (mod/mod_user/login-form.php): formularul în stânga, panou dark animat în dreapta.
 * Culoarea vine din paleta aplicației (--bs-primary din framework6-1-pal-*.css); a doua culoare a gradientului
 * e derivată din ea, ca orice paletă să dea un gradient potrivit. Modul dark urmează body.dark-version.
 */
.login-layout {
    --xl-accent: var(--bs-primary, #3b6dff);
    --xl-accent-2: color-mix(in srgb, var(--xl-accent) 55%, #7c5cff);
    /* butonul rămâne pe culoarea de bază a paletei și pe dark (accentul pentru dark e prea deschis pentru text alb) */
    --xl-btn-a: var(--bs-primary, #3b6dff); --xl-btn-b: color-mix(in srgb, var(--xl-btn-a) 55%, #7c5cff);
    --xl-ink: #0e111b; --xl-ink-2: #4a5063; --xl-ink-3: #8a90a3;
    --xl-paper: #fff; --xl-field: #f5f6fa; --xl-line: #e3e6ef;
    --xl-canvas: #070a14; --xl-glass: rgba(14, 19, 36, .55); --xl-glass-line: rgba(160, 180, 255, .16);
    --xl-on-dark: #eef1ff; --xl-on-dark-2: #a6aec8;
    --xl-radius: 14px;
    --xl-font: Inter, 'Open Sans', system-ui, sans-serif;
    --xl-font-display: Figtree, Inter, 'Open Sans', system-ui, sans-serif;
    background: var(--xl-paper) !important; color: var(--xl-ink);
    font: 400 15px/1.5 var(--xl-font);
}
body.login-layout.dark-version {
    --xl-accent: var(--f61-accent-on-dark, var(--bs-primary, #64a8f0));
    --xl-ink: #eef1ff; --xl-ink-2: #b8bfd6; --xl-ink-3: #7d849c;
    --xl-paper: #0b0f1c; --xl-field: #121829; --xl-line: #222a40;
}
/* la login utilizatorul nu e autentificat, deci nu avem setarea lui de dark mode: urmăm tema sistemului */
@media (prefers-color-scheme: dark) {
    body.login-layout {
        color-scheme: dark;
        --xl-accent: var(--f61-accent-on-dark, var(--bs-primary, #64a8f0));
        --xl-ink: #eef1ff; --xl-ink-2: #b8bfd6; --xl-ink-3: #7d849c;
        --xl-paper: #0b0f1c; --xl-field: #121829; --xl-line: #222a40;
    }
}
.login-layout #main-container { min-height: 100svh; padding: 0; display: block; overflow: visible; background: none; }

/* tema pune padding pe <main> și stil pe label: aici nu se aplică */
.login-layout .xl-auth { display: grid; grid-template-columns: minmax(380px, 5fr) 7fr; min-height: 100svh; padding: 0; margin: 0; }

/* —— formularul —— */
.xl-form { position: relative; display: flex; flex-direction: column; padding: 40px clamp(24px, 6vw, 88px); }
.xl-brand { display: flex; align-items: center; gap: 12px; font: 700 20px var(--xl-font-display); letter-spacing: -.02em; color: var(--xl-ink); }
.xl-logo { max-height: 52px; max-width: 220px; width: auto; }
.xl-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font: 700 17px var(--xl-font-display);
    background: linear-gradient(135deg, var(--xl-accent), var(--xl-accent-2)); box-shadow: 0 10px 30px -10px var(--xl-accent); }
.xl-wrap { margin: auto 0; max-width: 400px; width: 100%; padding: 48px 0; }
.xl-eyebrow { font: 500 12px 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--xl-accent); }
.login-layout .xl-title { font: 700 clamp(30px, 3.2vw, 40px)/1.08 var(--xl-font-display); letter-spacing: -.035em; margin: 10px 0; color: var(--xl-ink); }
.login-layout .xl-sub { color: var(--xl-ink-2); margin: 0 0 32px; font-size: 15px; line-height: 1.5; }

.xl-field { position: relative; margin-bottom: 14px; }
.xl-field input { width: 100%; height: 58px; padding: 22px 52px 6px 16px; font: 500 15px var(--xl-font); color: var(--xl-ink);
    background: var(--xl-field); border: 1px solid var(--xl-line); border-radius: var(--xl-radius); outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s; }
.login-layout .xl-field label { position: absolute; left: 17px; top: 19px; margin: 0; padding: 0; color: var(--xl-ink-3); font-size: 15px; font-weight: 400; line-height: 1.3; pointer-events: none; transition: all .18s ease; }
.xl-field input:focus, .xl-field input:not(:placeholder-shown) { background: var(--xl-paper); }
.xl-field input:focus { border-color: var(--xl-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--xl-accent) 18%, transparent); }
.login-layout .xl-field input:focus + label, .login-layout .xl-field input:not(:placeholder-shown) + label { top: 8px; font-weight: 500; font-size: 11.5px; letter-spacing: .02em; color: var(--xl-accent); }
/* completarea automată a browserului: aceeași etichetă sus și fără fundalul galben */
.login-layout .xl-field input:-webkit-autofill + label { top: 8px; font-size: 11.5px; }
.xl-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--xl-paper) inset; -webkit-text-fill-color: var(--xl-ink); }
.xl-eye { position: absolute; right: 8px; top: 9px; width: 40px; height: 40px; border: 0; background: none; color: var(--xl-ink-3); cursor: pointer; border-radius: 10px; }
.xl-eye:hover { color: var(--xl-ink); background: color-mix(in srgb, var(--xl-ink) 6%, transparent); }
.xl-eye .fa-eye-slash, .xl-eye[aria-pressed="true"] .fa-eye { display: none; }
.xl-eye[aria-pressed="true"] .fa-eye-slash { display: inline-block; }

/* alerta din formular (js/login.js, Custom_Alert): parola gresita, utilizator invalid, cont inactiv */
.xl-alert { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; padding: 12px 14px; border-radius: var(--xl-radius); font: 500 14px/1.4 var(--xl-font);
    color: var(--xl-alert-ink); background: var(--xl-alert-bg); border: 1px solid var(--xl-alert-line); animation: xl-alert-in .35s cubic-bezier(.2, .8, .2, 1); }
.xl-alert i { margin-top: 2px; font-size: 16px; }
.xl-alert-error { --xl-alert-ink: #b42318; --xl-alert-bg: #fef3f2; --xl-alert-line: #fecdca; }
.xl-alert-warning { --xl-alert-ink: #b54708; --xl-alert-bg: #fffaeb; --xl-alert-line: #fedf89; }
.xl-alert-success { --xl-alert-ink: #067647; --xl-alert-bg: #ecfdf3; --xl-alert-line: #abefc6; }
.xl-alert-info { --xl-alert-ink: #175cd3; --xl-alert-bg: #eff8ff; --xl-alert-line: #b2ddff; }
.xl-alert-error { animation: xl-alert-in .35s cubic-bezier(.2, .8, .2, 1), xl-alert-shake .4s .1s; }
body.login-layout.dark-version .xl-alert-error { --xl-alert-ink: #fda29b; --xl-alert-bg: rgba(240, 68, 56, .12); --xl-alert-line: rgba(240, 68, 56, .35); }
body.login-layout.dark-version .xl-alert-warning { --xl-alert-ink: #fec84b; --xl-alert-bg: rgba(247, 144, 9, .12); --xl-alert-line: rgba(247, 144, 9, .35); }
body.login-layout.dark-version .xl-alert-success { --xl-alert-ink: #75e0a7; --xl-alert-bg: rgba(18, 183, 106, .12); --xl-alert-line: rgba(18, 183, 106, .35); }
body.login-layout.dark-version .xl-alert-info { --xl-alert-ink: #84caff; --xl-alert-bg: rgba(21, 112, 239, .14); --xl-alert-line: rgba(21, 112, 239, .4); }
@media (prefers-color-scheme: dark) {
    body.login-layout .xl-alert-error { --xl-alert-ink: #fda29b; --xl-alert-bg: rgba(240, 68, 56, .12); --xl-alert-line: rgba(240, 68, 56, .35); }
    body.login-layout .xl-alert-warning { --xl-alert-ink: #fec84b; --xl-alert-bg: rgba(247, 144, 9, .12); --xl-alert-line: rgba(247, 144, 9, .35); }
    body.login-layout .xl-alert-success { --xl-alert-ink: #75e0a7; --xl-alert-bg: rgba(18, 183, 106, .12); --xl-alert-line: rgba(18, 183, 106, .35); }
    body.login-layout .xl-alert-info { --xl-alert-ink: #84caff; --xl-alert-bg: rgba(21, 112, 239, .14); --xl-alert-line: rgba(21, 112, 239, .4); }
}
@keyframes xl-alert-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes xl-alert-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.xl-btn { position: relative; display: block; width: 100%; height: 56px; margin-top: 22px; border: 0; border-radius: var(--xl-radius); cursor: pointer; overflow: hidden;
    font: 600 15.5px var(--xl-font); color: #fff; background: linear-gradient(110deg, var(--xl-btn-a), var(--xl-btn-b));
    box-shadow: 0 14px 34px -14px var(--xl-btn-a); transition: transform .2s, box-shadow .2s; }
.xl-btn:hover { transform: translateY(-1px); box-shadow: 0 20px 44px -14px var(--xl-btn-a); }
.xl-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--xl-accent) 45%, transparent); outline-offset: 3px; }
.xl-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-100%); animation: xl-shine 3.6s 1.2s ease-in-out infinite; }
@keyframes xl-shine { 0%, 60% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }
.xl-spin { display: none; width: 20px; height: 20px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: xl-rot .7s linear infinite; margin: auto; }
.xl-btn.is-loading .xl-btn-label { display: none; }
.xl-btn.is-loading .xl-spin { display: block; }
@keyframes xl-rot { to { transform: rotate(1turn); } }

.xl-foot { font-size: 12.5px; color: var(--xl-ink-3); }
.login-layout .xl-foot a { color: var(--xl-ink-2); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--xl-line); transition: color .2s, border-color .2s; }
.login-layout .xl-foot a:hover { color: var(--xl-accent); border-color: var(--xl-accent); }

/* intrare în scenă, decalată */
.xl-rise { opacity: 0; transform: translateY(14px); animation: xl-rise .8s cubic-bezier(.2, .7, .1, 1) forwards; }
@keyframes xl-rise { to { opacity: 1; transform: none; } }

/* —— panoul animat —— */
.xl-visual { position: relative; overflow: hidden; margin: 12px 12px 12px 0; border-radius: 28px; background: var(--xl-canvas); color: var(--xl-on-dark); isolation: isolate; }
.xl-net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.xl-photo { position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center; opacity: .35; }
.xl-aurora { position: absolute; inset: -20%; z-index: -1; filter: blur(70px); opacity: .7; }
.xl-aurora i { position: absolute; width: 46%; height: 46%; border-radius: 50%; animation: xl-drift 18s ease-in-out infinite alternate; }
.xl-aurora i:nth-child(1) { left: 8%; top: 4%; background: var(--xl-accent); }
.xl-aurora i:nth-child(2) { right: 4%; top: 30%; background: var(--xl-accent-2); animation-duration: 22s; animation-delay: -6s; }
.xl-aurora i:nth-child(3) { left: 30%; bottom: 0; background: #0ea5e9; opacity: .5; animation-duration: 26s; }
@keyframes xl-drift { to { transform: translate(8%, 10%) scale(1.15); } }
.xl-grid { position: absolute; inset: 0; z-index: -1;
    background-image: linear-gradient(rgba(160, 180, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(160, 180, 255, .07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, #000 30%, transparent 80%); -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, #000 30%, transparent 80%); }

.xl-copy { position: absolute; left: clamp(28px, 4vw, 56px); right: clamp(28px, 4vw, 56px); bottom: clamp(28px, 4vw, 52px); z-index: 2; }
.login-layout .xl-copy h2 { font: 600 clamp(26px, 2.6vw, 38px)/1.1 var(--xl-font-display); letter-spacing: -.03em; margin: 12px 0 10px; max-width: 520px; color: var(--xl-on-dark); }
.login-layout .xl-copy p { color: var(--xl-on-dark-2); max-width: 460px; margin: 0; }
.xl-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font: 500 11.5px 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: .08em;
    background: var(--xl-glass); border: 1px solid var(--xl-glass-line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.xl-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; animation: xl-ping 2s infinite; }
@keyframes xl-ping { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 70%, 100% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } }

/* cartele "live" (js/login.js): activitate generică, valabilă în orice aplicație */
.xl-feed { position: absolute; top: clamp(28px, 6vh, 64px); right: clamp(28px, 4vw, 56px); width: min(340px, 60%); z-index: 2; display: flex; flex-direction: column; gap: 10px; }
.xl-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--xl-glass); border: 1px solid var(--xl-glass-line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .8);
    animation: xl-card-in .7s cubic-bezier(.2, .7, .1, 1) both; }
.xl-card .xl-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 15px;
    background: color-mix(in srgb, var(--xl-accent) 30%, transparent); }
.xl-card .xl-t { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.xl-card .xl-m { font: 11px 'IBM Plex Mono', ui-monospace, monospace; color: var(--xl-on-dark-2); margin-top: 2px; }
.xl-card.is-out { animation: xl-card-out .5s ease forwards; }
@keyframes xl-card-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
@keyframes xl-card-out { to { opacity: 0; transform: translateX(20px); } }

/* iOS Safari mareste pagina la focus intr-un camp cu text sub 16px: pe telefon campurile loginului au 16px */
@media (max-width: 767.98px) {
    .xl-field input { font-size: 16px; }
}

@media (max-width: 900px) {
    .login-layout .xl-auth { grid-template-columns: 1fr; }
    .xl-visual { order: -1; margin: 10px 10px 0; min-height: 240px; border-radius: 22px; }
    .xl-feed, .xl-copy p { display: none; }
    .xl-copy { bottom: 22px; }
    .login-layout .xl-copy h2 { font-size: 24px; }
    .xl-form { padding: 24px 20px 32px; }
    .xl-wrap { padding: 28px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .login-layout *, .login-layout *::before, .login-layout *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
