/* Sign-in styled to match the app: light surface, teal accent, glass panels,
   soft shadows. Scoped to the login page. */

body[data-page="login"] {
    margin: 0;
    /* Mirror the app's page background so login feels like part of the product. */
    background:
        linear-gradient(135deg, rgba(20, 163, 139, 0.12), transparent 34%),
        linear-gradient(315deg, rgba(255, 107, 74, 0.10), transparent 30%),
        repeating-linear-gradient(90deg, rgba(23, 33, 43, 0.025) 0 1px, transparent 1px 92px),
        var(--bg);
}

/* Full-bleed: drop the constrained content container for this page only. */
body[data-page="login"] .container {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
}

/* Flash (e.g. bad credentials) floats above the scene. */
body[data-page="login"] .flash {
    position: fixed;
    z-index: 40;
    top: max(1rem, env(safe-area-inset-top));
    left: 50%;
    width: min(460px, calc(100vw - 2rem));
    margin: 0;
    transform: translateX(-50%);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(23, 33, 43, 0.16);
    animation: lx-flash-in 0.35s ease both;
}
@keyframes lx-flash-in { from { opacity: 0; transform: translate(-50%, -12px); } }

.loginx {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: clamp(1rem, 3vw, 2.6rem);
    overflow: hidden;
    isolation: isolate;
    color: var(--ink);
    font-family: var(--ui-body-font, 'Manrope', system-ui, sans-serif);
}

/* ---- Soft ambient glows (subtle, light) ---- */
.loginx-aurora { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.loginx-orb { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.loginx-orb-a { width: 46vmax; height: 46vmax; left: -16vmax; top: -18vmax; opacity: 0.5; background: radial-gradient(circle, rgba(20, 163, 139, 0.5), transparent 62%); animation: lx-orb-a 20s ease-in-out infinite; }
.loginx-orb-b { width: 40vmax; height: 40vmax; right: -16vmax; bottom: -18vmax; opacity: 0.4; background: radial-gradient(circle, rgba(255, 138, 101, 0.42), transparent 62%); animation: lx-orb-b 24s ease-in-out infinite; }
.loginx-orb-c { width: 28vmax; height: 28vmax; left: 44%; top: 26%; opacity: 0.3; background: radial-gradient(circle, rgba(25, 189, 161, 0.4), transparent 60%); animation: lx-orb-c 28s ease-in-out infinite; }
@keyframes lx-orb-a { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(5vmax, 4vmax) scale(1.08); } }
@keyframes lx-orb-b { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-4vmax, -4vmax) scale(1.1); } }
@keyframes lx-orb-c { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-42%, -60%) scale(1.14); } }
/* The app background already carries pinstripes; keep the mesh whisper-faint. */
.loginx-mesh {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(20, 163, 139, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 163, 139, 0.05) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 24%, transparent 72%);
    mask-image: radial-gradient(circle at 50% 40%, #000 24%, transparent 72%);
}
.loginx-noise { display: none; }

/* ---- Layout ---- */
.loginx-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 4.5rem);
    width: min(1060px, 100%);
}

/* ---- Hero ---- */
.loginx-hero { display: grid; align-content: center; gap: clamp(1.3rem, 3vw, 2rem); }
.loginx-brand { display: inline-flex; align-items: center; gap: 0.72rem; }
.loginx-brand-mark {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, #19bda1, var(--primary-dark));
    box-shadow: 0 12px 28px rgba(20, 163, 139, 0.3);
}
.loginx-brand-mark svg { width: 26px; height: 26px; }
.loginx-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.loginx-brand-name { font-family: var(--ui-display-font, 'Plus Jakarta Sans', sans-serif); font-weight: 800; font-size: 1.05rem; color: var(--ink); }

.loginx-hero-copy { display: grid; gap: 0.6rem; }
.loginx-eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--primary-dark); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.loginx-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); animation: lx-pulse 1.9s ease-out infinite; }
@keyframes lx-pulse { to { box-shadow: 0 0 0 10px transparent; } }
.loginx-headline {
    margin: 0;
    font-family: var(--ui-display-font, 'Plus Jakarta Sans', sans-serif);
    font-weight: 800;
    font-size: clamp(2rem, 4.4vw, 3.2rem);
    line-height: 1.06;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, var(--ink) 30%, var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.loginx-tagline { margin: 0; max-width: 40ch; color: var(--muted); font-size: clamp(0.95rem, 1.4vw, 1.05rem); line-height: 1.6; }

.loginx-equalizer { display: flex; align-items: flex-end; gap: 6px; height: 40px; }
.loginx-equalizer i { width: 6px; height: 30%; border-radius: 99px; background: linear-gradient(180deg, #19bda1, var(--primary)); opacity: 0.9; animation: lx-eq 1.25s ease-in-out infinite; }
.loginx-equalizer i:nth-child(1) { animation-delay: -0.1s; }
.loginx-equalizer i:nth-child(2) { animation-delay: -0.5s; }
.loginx-equalizer i:nth-child(3) { animation-delay: -0.9s; }
.loginx-equalizer i:nth-child(4) { animation-delay: -0.3s; }
.loginx-equalizer i:nth-child(5) { animation-delay: -0.7s; }
.loginx-equalizer i:nth-child(6) { animation-delay: -0.15s; }
.loginx-equalizer i:nth-child(7) { animation-delay: -0.6s; }
.loginx-equalizer i:nth-child(8) { animation-delay: -0.4s; }
.loginx-equalizer i:nth-child(9) { animation-delay: -0.85s; }
@keyframes lx-eq { 0%, 100% { height: 22%; } 50% { height: 100%; } }

/* ---- Card (matches .glass-panel) ---- */
.loginx-panel { display: grid; }
.loginx-card {
    position: relative;
    padding: clamp(1.5rem, 3vw, 2.4rem);
    border: 1px solid var(--ui-soft-border);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 253, 250, 0.78)),
        var(--surface);
    box-shadow: 0 24px 60px rgba(23, 33, 43, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
}

.loginx-card-head { display: grid; gap: 0.32rem; margin-bottom: 1.3rem; }
.loginx-card-logo {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #19bda1, var(--primary-dark));
}
.loginx-card-logo svg { width: 24px; height: 24px; }
.loginx-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.loginx-card-title { margin: 0; color: var(--ink); font-family: var(--ui-display-font, 'Plus Jakarta Sans', sans-serif); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.01em; }
.loginx-card-subtitle { margin: 0; color: var(--muted); font-size: 0.8rem; }

/* ---- Form ---- */
.loginx-form { display: grid; gap: 0.95rem; }
.loginx-field { display: grid; gap: 0.4rem; }
.loginx-field-label { color: var(--ink); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.01em; }
.loginx-field-control { position: relative; display: flex; align-items: center; }
.loginx-field-icon { position: absolute; left: 0.85rem; display: grid; place-items: center; color: var(--muted); pointer-events: none; transition: color 0.16s ease; }
.loginx-field-icon svg { width: 18px; height: 18px; }
.loginx-field input {
    width: 100%;
    min-height: 50px;
    padding: 0 1rem 0 2.65rem;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.loginx-field input::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
.loginx-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.loginx-field:focus-within .loginx-field-icon { color: var(--primary-dark); }

.loginx-remember { position: relative; display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px; padding: 12px 4px; margin: -12px -4px; cursor: pointer; user-select: none; }
.loginx-remember input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.loginx-remember-box { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); transition: background 0.14s ease, border-color 0.14s ease; }
.loginx-remember-box::after { content: ""; width: 10px; height: 5.5px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) scale(0); transition: transform 0.14s ease; }
.loginx-remember input:checked + .loginx-remember-box { border-color: transparent; background: linear-gradient(135deg, #19bda1, var(--primary-dark)); }
.loginx-remember input:checked + .loginx-remember-box::after { transform: rotate(-45deg) scale(1); }
.loginx-remember input:focus-visible + .loginx-remember-box { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
.loginx-remember-text { color: var(--muted); font-size: 0.82rem; }

.loginx-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 52px;
    margin-top: 0.4rem;
    border: 0;
    border-radius: 13px;
    color: #fff;
    font-family: var(--ui-display-font, 'Plus Jakarta Sans', sans-serif);
    font-weight: 800;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #0b7f70);
    box-shadow: 0 14px 30px rgba(20, 163, 139, 0.32);
    transition: transform 0.14s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.loginx-submit:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(20, 163, 139, 0.42); filter: brightness(1.03); }
.loginx-submit:active { transform: translateY(0); }
.loginx-submit:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.loginx-submit-arrow { font-size: 1.15rem; transition: transform 0.18s ease; }
.loginx-submit:hover .loginx-submit-arrow { transform: translateX(4px); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .loginx-shell { grid-template-columns: 1fr; gap: 1.6rem; width: min(430px, 100%); }
    .loginx-headline { font-size: clamp(1.85rem, 8vw, 2.4rem); }
    .loginx-tagline { max-width: none; }
    .loginx-equalizer { height: 32px; }
    /* Below 860px the hero stacks directly above the card, so the app icon (and name)
       rendered twice back to back. The card head already re-states both a few lines
       down, so drop the hero's copy here and let the card carry the identity. */
    .loginx-brand { display: none; }
}
@media (max-width: 480px) {
    .loginx { padding: 1.1rem; }
    .loginx-card { padding: 1.35rem; border-radius: 20px; }
    .loginx-hero { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .loginx-orb, .loginx-equalizer i, .loginx-live-dot { animation: none !important; }
    .loginx-submit, .loginx-submit-arrow, .loginx-orb { transition: none; }
}
