/* «تسجيل الدخول» (login_view.php) + the welcome page (include/logo_view.php). Stand-alone, no framework, scoped to .lg-body.
   Light / dark: the device's choice, or the app's saved choice (html[data-theme]). Motion off with prefers-reduced-motion. */

.lg-body {
    --lg-bg-0: #040a1c;
    --lg-bg-1: #0a1838;
    --lg-glow-a: rgba(37, 99, 235, 0.55);
    --lg-glow-b: rgba(124, 58, 237, 0.45);
    --lg-glow-c: rgba(14, 165, 233, 0.35);
    --lg-surface: #ffffff;
    --lg-surface-2: #f4f6fb;
    --lg-ink: #0f172a;
    --lg-ink-2: #475569;
    --lg-ink-3: #64748b;
    --lg-line: #dde3ee;
    --lg-line-2: #c3cddf;
    --lg-brand: #2563eb;
    --lg-brand-2: #6d28d9;
    --lg-brand-ink: #ffffff;
    --lg-brand-soft: rgba(37, 99, 235, 0.14);
    --lg-ok: #059669;
    --lg-ok-soft: rgba(5, 150, 105, 0.12);
    --lg-err: #dc2626;
    --lg-err-soft: rgba(220, 38, 38, 0.09);
    --lg-warn: #b45309;
    --lg-warn-soft: rgba(245, 158, 11, 0.14);
    --lg-panel-a: #0b1d4d;
    --lg-panel-b: #1e3a8a;
    --lg-shadow: 0 40px 90px rgba(2, 6, 23, 0.5), 0 2px 8px rgba(2, 6, 23, 0.2);
    --lg-radius: 28px;
    --lg-field-radius: 14px;
    --lg-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --lg-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .lg-body {
        --lg-surface: #0e1629;
        --lg-surface-2: #152039;
        --lg-ink: #e8edf7;
        --lg-ink-2: #b4c0d4;
        --lg-ink-3: #8c9ab3;
        --lg-line: #24324f;
        --lg-line-2: #36476b;
        --lg-brand: #4f8cff;
        --lg-brand-2: #8b5cf6;
        --lg-brand-soft: rgba(79, 140, 255, 0.2);
        --lg-ok: #34d399;
        --lg-ok-soft: rgba(52, 211, 153, 0.14);
        --lg-err: #f87171;
        --lg-err-soft: rgba(248, 113, 113, 0.13);
        --lg-warn: #fbbf24;
        --lg-warn-soft: rgba(251, 191, 36, 0.14);
        --lg-panel-a: #091433;
        --lg-panel-b: #172e6e;
        --lg-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(148, 163, 184, 0.08);
        color-scheme: dark;
    }
}

html[data-theme="dark"] .lg-body {
    --lg-surface: #0e1629;
    --lg-surface-2: #152039;
    --lg-ink: #e8edf7;
    --lg-ink-2: #b4c0d4;
    --lg-ink-3: #8c9ab3;
    --lg-line: #24324f;
    --lg-line-2: #36476b;
    --lg-brand: #4f8cff;
    --lg-brand-2: #8b5cf6;
    --lg-brand-soft: rgba(79, 140, 255, 0.2);
    --lg-ok: #34d399;
    --lg-ok-soft: rgba(52, 211, 153, 0.14);
    --lg-err: #f87171;
    --lg-err-soft: rgba(248, 113, 113, 0.13);
    --lg-warn: #fbbf24;
    --lg-warn-soft: rgba(251, 191, 36, 0.14);
    --lg-panel-a: #091433;
    --lg-panel-b: #172e6e;
    --lg-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(148, 163, 184, 0.08);
    color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
.lg-body,
.lg-body *,
.lg-body *::before,
.lg-body *::after {
    box-sizing: border-box;
}

html {
    background: #040a1c;
}

.lg-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--lg-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--lg-ink);
    background: linear-gradient(160deg, var(--lg-bg-1), var(--lg-bg-0) 72%);
    background-color: var(--lg-bg-0);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

.lg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.lg-body svg {
    width: 20px;
    height: 20px;
    flex: none;
}

.lg-body [hidden] {
    display: none !important;
}

/* :where() = no specificity, so .lg-btn / .lg-link / .lg-store keep their own colours */
:where(.lg-body) button,
:where(.lg-body) input {
    font: inherit;
    color: inherit;
}

/* ------------------------------------------------------------------ aurora background */
.lg-aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.lg-aurora span {
    position: absolute;
    width: 62vmax;
    height: 62vmax;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.85;
    will-change: transform;
}

.lg-aurora span:nth-child(1) {
    background: radial-gradient(circle, var(--lg-glow-a), transparent 65%);
    top: -28vmax;
    inset-inline-start: -18vmax;
    animation: lg-drift-a 22s var(--lg-ease) infinite alternate;
}

.lg-aurora span:nth-child(2) {
    background: radial-gradient(circle, var(--lg-glow-b), transparent 65%);
    bottom: -30vmax;
    inset-inline-end: -20vmax;
    animation: lg-drift-b 26s var(--lg-ease) infinite alternate;
}

.lg-aurora span:nth-child(3) {
    background: radial-gradient(circle, var(--lg-glow-c), transparent 65%);
    top: 30%;
    inset-inline-end: 30%;
    width: 40vmax;
    height: 40vmax;
    opacity: 0.55;
    animation: lg-drift-c 30s var(--lg-ease) infinite alternate;
}

@keyframes lg-drift-a {
    to { transform: translate3d(8vmax, 6vmax, 0) scale(1.08); }
}

@keyframes lg-drift-b {
    to { transform: translate3d(-7vmax, -5vmax, 0) scale(1.1); }
}

@keyframes lg-drift-c {
    to { transform: translate3d(5vmax, -6vmax, 0) scale(0.92); }
}

/* ------------------------------------------------------------------ layout */
.lg-stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.lg-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(300px, 400px) 1fr;
    background: var(--lg-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--lg-radius);
    box-shadow: var(--lg-shadow);
    overflow: hidden;
    animation: lg-rise 0.7s var(--lg-ease) both;
}

@keyframes lg-rise {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.lg-copy {
    margin: 0;
    font-size: 13px;
    color: rgba(226, 232, 240, 0.62);
    text-align: center;
}

/* ------------------------------------------------------------------ brand panel (computers) */
.lg-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 48px 36px;
    color: #fff;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(96, 165, 250, 0.28), transparent 60%),
        radial-gradient(90% 70% at 100% 100%, rgba(139, 92, 246, 0.32), transparent 60%),
        linear-gradient(165deg, var(--lg-panel-b), var(--lg-panel-a));
    overflow: hidden;
    isolation: isolate;
}

.lg-brand::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 255, 255, 0.09) 80%, transparent 90%);
    animation: lg-spin 16s linear infinite;
    z-index: -1;
}

.lg-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
    z-index: -1;
}

@keyframes lg-spin {
    to { transform: rotate(360deg); }
}

.lg-brand__mark {
    position: relative;
    width: 128px;
    height: 128px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.05), 0 20px 50px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: lg-float 6s ease-in-out infinite;
}

@keyframes lg-float {
    50% { transform: translateY(-6px); }
}

.lg-brand__logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.lg-brand__name {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.lg-brand__latin {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(219, 234, 254, 0.78);
}

.lg-brand__tag {
    margin: 10px 0 0;
    max-width: 30ch;
    font-size: 14px;
    color: rgba(226, 232, 240, 0.8);
}

.lg-brand__points {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 280px;
}

.lg-brand__points li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 14px;
    text-align: start;
}

.lg-brand__points svg {
    color: #93c5fd;
}

/* ------------------------------------------------------------------ the form card */
.lg-card {
    position: relative;
    padding: 48px 48px 40px;
    background: var(--lg-surface);
    min-width: 0;
}

.lg-mhead {
    display: none;
}

.lg-view {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.lg-view.is-enter {
    animation: lg-in-fwd 0.42s var(--lg-ease) both;
}

.lg-view.is-enter.is-back {
    animation-name: lg-in-back;
}

@keyframes lg-in-fwd {
    from { opacity: 0; transform: translateX(-22px); }
    to { opacity: 1; transform: none; }
}

@keyframes lg-in-back {
    from { opacity: 0; transform: translateX(22px); }
    to { opacity: 1; transform: none; }
}

.lg-head {
    margin-bottom: 4px;
}

.lg-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--lg-ink);
    outline: none;
}

.lg-lead {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--lg-ink-2);
}

.lg-target {
    font-weight: 600;
    color: var(--lg-ink);
    unicode-bidi: isolate;
}

/* fields */
.lg-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.lg-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--lg-ink-2);
}

.lg-input {
    position: relative;
    display: flex;
    align-items: center;
}

.lg-input input {
    width: 100%;
    height: 52px;
    /* physical sides: the page is RTL (icon on the right, eye on the left) while some inputs are dir=ltr */
    padding: 0 46px 0 48px;
    font-size: 16px;
    color: var(--lg-ink);
    background: var(--lg-surface-2);
    border: 1.5px solid var(--lg-line);
    border-radius: var(--lg-field-radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    text-align: start;
}

.lg-input input[dir="ltr"] {
    text-align: right;
}

.lg-input input::placeholder {
    color: var(--lg-ink-3);
    opacity: 0.75;
}

.lg-input input:hover {
    border-color: var(--lg-line-2);
}

.lg-input input:focus {
    background: var(--lg-surface);
    border-color: var(--lg-brand);
    box-shadow: 0 0 0 4px var(--lg-brand-soft);
}

.lg-input input.is-invalid {
    border-color: var(--lg-err);
    box-shadow: 0 0 0 4px var(--lg-err-soft);
}

.lg-input__icon {
    position: absolute;
    inset-inline-start: 15px;
    color: var(--lg-ink-3);
    pointer-events: none;
    transition: color 0.2s;
}

.lg-input:focus-within .lg-input__icon {
    color: var(--lg-brand);
}

.lg-eye,
.lg-match {
    position: absolute;
    inset-inline-end: 6px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--lg-ink-3);
}

.lg-eye {
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.lg-eye:hover {
    background: var(--lg-brand-soft);
    color: var(--lg-brand);
}

.lg-eye:focus-visible {
    outline: 2px solid var(--lg-brand);
    outline-offset: 1px;
}

.lg-eye__off,
.lg-eye[aria-pressed="true"] .lg-eye__on {
    display: none;
}

.lg-eye[aria-pressed="true"] .lg-eye__off {
    display: block;
}

.lg-match {
    color: var(--lg-ok);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s, transform 0.3s var(--lg-ease);
}

.lg-match.is-on {
    opacity: 1;
    transform: none;
}

.lg-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    color: var(--lg-ink-3);
}

.lg-hint svg {
    width: 16px;
    height: 16px;
}

.lg-caps {
    color: var(--lg-warn);
    font-weight: 600;
}

/* remember + forgot row */
.lg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: -4px;
}

.lg-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--lg-ink-2);
    cursor: pointer;
    user-select: none;
    min-height: 44px;
}

.lg-check input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.lg-check__box {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--lg-line-2);
    border-radius: 7px;
    background: var(--lg-surface-2);
    color: #fff;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--lg-ease);
}

.lg-check__box svg {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.15s, transform 0.25s var(--lg-ease);
}

.lg-check input:checked + .lg-check__box {
    background: var(--lg-brand);
    border-color: var(--lg-brand);
}

.lg-check input:checked + .lg-check__box svg {
    opacity: 1;
    transform: none;
}

.lg-check input:focus-visible + .lg-check__box {
    box-shadow: 0 0 0 4px var(--lg-brand-soft);
}

.lg-check:active .lg-check__box {
    transform: scale(0.9);
}

.lg-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 2px;
    border: 0;
    background: none;
    color: var(--lg-brand);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border-radius: 6px;
}

.lg-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.lg-link:focus-visible,
.lg-back:focus-visible,
.lg-store:focus-visible {
    outline: 2px solid var(--lg-brand);
    outline-offset: 2px;
}

.lg-link svg {
    width: 16px;
    height: 16px;
}

/* buttons */
.lg-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--lg-field-radius);
    background: linear-gradient(135deg, var(--lg-brand), var(--lg-brand-2));
    background-size: 160% 160%;
    background-position: 0% 50%;
    color: var(--lg-brand-ink);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 28px -10px rgba(37, 99, 235, 0.7);
    transition: transform 0.2s var(--lg-ease), box-shadow 0.25s, background-position 0.5s var(--lg-ease), opacity 0.2s;
    overflow: hidden;
    isolation: isolate;
}

.lg-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(110%);
    z-index: -1;
}

.lg-btn:hover {
    transform: translateY(-1px);
    background-position: 100% 50%;
    box-shadow: 0 16px 34px -12px rgba(37, 99, 235, 0.8);
}

.lg-btn:hover::after {
    animation: lg-sheen 0.9s var(--lg-ease);
}

@keyframes lg-sheen {
    to { transform: translateX(-110%); }
}

.lg-btn:active {
    transform: scale(0.985);
}

.lg-btn:focus-visible {
    outline: 3px solid var(--lg-brand-soft);
    outline-offset: 3px;
}

.lg-btn[disabled] {
    cursor: not-allowed;
}

.lg-btn__spin {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lg-turn 0.7s linear infinite;
}

.lg-btn.is-busy {
    cursor: wait;
    opacity: 0.92;
}

.lg-btn.is-busy .lg-btn__spin {
    display: block;
}

.lg-btn.is-ok {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 12px 28px -10px rgba(5, 150, 105, 0.7);
}

@keyframes lg-turn {
    to { transform: rotate(360deg); }
}

.lg-btn--ghost {
    background: var(--lg-surface-2);
    color: var(--lg-brand);
    border: 1.5px solid var(--lg-line);
    box-shadow: none;
}

.lg-btn--ghost:hover {
    background: var(--lg-brand-soft);
    box-shadow: none;
}

.lg-back {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--lg-ink-2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.lg-back:hover {
    color: var(--lg-brand);
    background: var(--lg-brand-soft);
}

.lg-back svg {
    width: 18px;
    height: 18px;
}

/* messages */
.lg-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--lg-err) 30%, transparent);
    background: var(--lg-err-soft);
    color: var(--lg-err);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    animation: lg-pop 0.3s var(--lg-ease) both;
}

.lg-alert::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.lg-alert.is-ok {
    border-color: color-mix(in srgb, var(--lg-ok) 30%, transparent);
    background: var(--lg-ok-soft);
    color: var(--lg-ok);
}

.lg-alert.is-shake {
    animation: lg-shake 0.42s var(--lg-ease) both;
}

@keyframes lg-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

@keyframes lg-shake {
    0%, 100% { transform: none; }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
}

/* app links (app-only accounts) */
.lg-apps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--lg-line);
    border-radius: 14px;
    background: var(--lg-surface-2);
    animation: lg-pop 0.35s var(--lg-ease) both;
}

.lg-apps__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--lg-ink);
}

.lg-apps__group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.lg-apps__name {
    min-width: 92px;
    font-size: 13px;
    color: var(--lg-ink-2);
}

.lg-store {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    background: #0b1220;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    direction: ltr;
    transition: transform 0.2s var(--lg-ease), background-color 0.2s;
}

.lg-store:hover {
    transform: translateY(-1px);
    background: #1e293b;
}

.lg-store svg {
    width: 18px;
    height: 18px;
}

.lg-foot {
    margin: 4px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--lg-line);
    font-size: 14px;
    color: var(--lg-ink-3);
    text-align: center;
}

/* ------------------------------------------------------------------ code (6 boxes over one real input) */
.lg-code {
    position: relative;
    direction: ltr;
}

.lg-code__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0;
    border: 0;
    font-size: 16px;
    letter-spacing: 3em;
    caret-color: transparent;
    cursor: text;
}

.lg-code__slots {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.lg-code__slots span {
    position: relative;
    height: 60px;
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--lg-ink);
    background: var(--lg-surface-2);
    border: 1.5px solid var(--lg-line);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, transform 0.2s var(--lg-ease);
}

.lg-code__slots span.is-filled {
    background: var(--lg-surface);
    border-color: var(--lg-line-2);
    animation: lg-slot 0.28s var(--lg-ease);
}

@keyframes lg-slot {
    50% { transform: scale(1.08); }
}

.lg-code.is-focus .lg-code__slots span.is-active {
    border-color: var(--lg-brand);
    box-shadow: 0 0 0 4px var(--lg-brand-soft);
    background: var(--lg-surface);
}

.lg-code.is-focus .lg-code__slots span.is-active::after {
    content: "";
    width: 2px;
    height: 26px;
    border-radius: 2px;
    background: var(--lg-brand);
    animation: lg-caret 1s steps(1) infinite;
}

@keyframes lg-caret {
    50% { opacity: 0; }
}

.lg-code.is-invalid .lg-code__slots span {
    border-color: var(--lg-err);
}

.lg-code.is-shake .lg-code__slots {
    animation: lg-shake 0.42s var(--lg-ease);
}

.lg-resend-line {
    justify-content: space-between;
    min-height: 44px;
}

.lg-resend-line b {
    font-variant-numeric: tabular-nums;
    color: var(--lg-ink-2);
}

/* password rules */
.lg-rules {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
    font-size: 13px;
    color: var(--lg-ink-3);
}

.lg-rules li {
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.2s;
}

.lg-rules li::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--lg-line-2);
    transition: background-color 0.2s, border-color 0.2s, transform 0.25s var(--lg-ease);
}

.lg-rules li[data-rule="plain"] {
    grid-column: 1 / -1;
}

.lg-rules li.is-ok {
    color: var(--lg-ok);
}

.lg-rules li.is-ok::before {
    border-color: var(--lg-ok);
    background: var(--lg-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 11px no-repeat;
    transform: scale(1.05);
}

.lg-rules li.is-bad {
    color: var(--lg-err);
}

.lg-rules li.is-bad::before {
    border-color: var(--lg-err);
}

/* ------------------------------------------------------------------ done */
.lg-done {
    align-items: center;
    text-align: center;
    padding: 24px 0 8px;
}

.lg-done__badge {
    width: 92px;
    height: 92px;
    margin-bottom: 4px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--lg-ok-soft);
    animation: lg-pop 0.4s var(--lg-ease) both;
}

.lg-done__badge svg {
    width: 64px;
    height: 64px;
    fill: none;
    stroke: var(--lg-ok);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lg-done__badge circle {
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: lg-draw 0.6s var(--lg-ease) 0.1s forwards;
}

.lg-done__badge path {
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: lg-draw 0.4s var(--lg-ease) 0.55s forwards;
}

@keyframes lg-draw {
    to { stroke-dashoffset: 0; }
}

.lg-done .lg-btn {
    margin-top: 8px;
    max-width: 320px;
}

/* ------------------------------------------------------------------ welcome page (include/logo_view.php) */
.lg-welcome {
    width: min(520px, 100%);
    padding: 44px 36px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    background: var(--lg-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--lg-radius);
    box-shadow: var(--lg-shadow);
    animation: lg-rise 0.7s var(--lg-ease) both;
}

.lg-welcome .lg-brand__mark {
    background: linear-gradient(165deg, var(--lg-panel-b), var(--lg-panel-a));
    border-color: transparent;
    margin-bottom: 10px;
}

.lg-welcome__hello {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--lg-brand);
}

.lg-welcome__latin {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--lg-ink-3);
}

.lg-welcome .lg-lead {
    max-width: 38ch;
}

.lg-notice {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--lg-warn) 35%, transparent);
    background: var(--lg-warn-soft);
    color: var(--lg-warn);
    font-size: 14px;
    font-weight: 600;
    text-align: start;
    animation: lg-pop 0.4s var(--lg-ease) 0.3s both;
}

.lg-welcome .lg-btn {
    margin-top: 14px;
}

.lg-noscript {
    position: fixed;
    inset: auto 16px 16px;
    z-index: 5;
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fef2f2;
    color: #991b1b;
    font: 600 14px/1.5 var(--lg-font);
    text-align: center;
}

/* ------------------------------------------------------------------ tablets and phones */
@media (max-width: 899.98px) {
    .lg-shell {
        grid-template-columns: 1fr;
        width: min(480px, 100%);
    }

    .lg-brand {
        display: none;
    }

    .lg-card {
        padding: 32px 28px 28px;
    }

    .lg-mhead {
        display: flex;
        justify-content: center;
        margin: -4px 0 18px;
    }

    .lg-mhead__logo {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        object-fit: cover;
        background: #fff;
        box-shadow: 0 0 0 6px var(--lg-brand-soft), 0 14px 30px -12px rgba(2, 6, 23, 0.5);
    }

    .lg-head {
        text-align: center;
    }
}

@media (max-width: 479.98px) {
    .lg-stage {
        justify-content: flex-start;
        padding-top: max(20px, env(safe-area-inset-top));
        gap: 14px;
    }

    .lg-shell,
    .lg-welcome {
        border-radius: 24px;
    }

    .lg-card {
        padding: 26px 18px 22px;
    }

    .lg-welcome {
        padding: 34px 20px 26px;
    }

    .lg-title {
        font-size: 24px;
    }

    .lg-lead {
        font-size: 14px;
    }

    .lg-code__slots {
        gap: 7px;
    }

    .lg-code__slots span {
        height: 54px;
        font-size: 23px;
        border-radius: 12px;
    }

    .lg-rules {
        grid-template-columns: 1fr;
    }

    .lg-apps__name {
        width: 100%;
    }
}

@media (max-width: 359.98px) {
    .lg-code__slots {
        gap: 5px;
    }

    .lg-code__slots span {
        height: 48px;
        font-size: 20px;
    }
}

/* phones held sideways: less vertical space */
@media (max-height: 520px) and (orientation: landscape) {
    .lg-stage {
        justify-content: flex-start;
        padding-top: 14px;
    }

    .lg-mhead {
        display: none;
    }

    .lg-card {
        padding-top: 22px;
    }

    .lg-view {
        gap: 12px;
    }

    .lg-input input,
    .lg-btn {
        height: 48px;
    }

    .lg-code__slots span {
        height: 48px;
    }
}

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lg-body *,
    .lg-body *::before,
    .lg-body *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
        transition-duration: 0.001ms !important;
    }

    .lg-aurora span,
    .lg-brand::before,
    .lg-brand__mark {
        animation: none !important;
    }

    .lg-done__badge circle,
    .lg-done__badge path {
        stroke-dashoffset: 0;
    }
}
