/* LeadzMania Auth — floating sheet (new system) */
:root {
    --a-green: #00BC7D;
    --a-green-rgb: 0, 188, 125;
    --a-green-deep: #008F60;
    --a-ink: #102019;
    --a-muted: #61766c;
    --a-line: #cfe0d7;
    --a-paper: #e8f2ec;
    --a-sheet: #ffffff;
    --a-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    --a-display: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif;
}

html[data-theme="dark"] {
    --a-ink: #eaf6ef;
    --a-muted: #97adA2;
    --a-line: #2b3c34;
    --a-paper: #08110d;
    --a-sheet: #101916;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body.lm-auth-body {
    margin: 0;
    height: 100%;
    overflow: hidden;
}

body.lm-auth-body {
    font-family: var(--a-font);
    color: var(--a-ink);
    background: var(--a-paper);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--a-green-deep); }
a:hover { color: var(--a-green); }

.lm-auth {
    position: relative;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

/* Atmospheric world */
.lm-auth-world {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 520px at 100% 0%, rgba(var(--a-green-rgb), 0.28), transparent 55%),
        radial-gradient(700px 500px at 0% 100%, rgba(var(--a-green-rgb), 0.16), transparent 50%),
        linear-gradient(160deg, #f5fbf7 0%, var(--a-paper) 45%, #dceee4 100%);
}

html[data-theme="dark"] .lm-auth-world {
    background:
        radial-gradient(900px 520px at 100% 0%, rgba(var(--a-green-rgb), 0.22), transparent 55%),
        radial-gradient(700px 500px at 0% 100%, rgba(var(--a-green-rgb), 0.12), transparent 50%),
        linear-gradient(160deg, #0d1713 0%, var(--a-paper) 50%, #07100c 100%);
}

.lm-auth-wash {
    position: absolute;
    inset: 12% 8%;
    border: 1px solid rgba(var(--a-green-rgb), 0.18);
    border-radius: 36px;
    transform: rotate(-2deg);
}

.lm-auth-beam {
    position: absolute;
    top: -20%;
    left: 42%;
    width: 2px;
    height: 140%;
    background: linear-gradient(180deg, transparent, rgba(var(--a-green-rgb), 0.45), transparent);
    transform: rotate(18deg);
    animation: aBeam 5.5s ease-in-out infinite;
}

.lm-auth-mark {
    position: absolute;
    right: -2%;
    bottom: 4%;
    font-family: var(--a-display);
    font-size: clamp(5rem, 18vw, 12rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.8;
    color: rgba(var(--a-green-rgb), 0.09);
    user-select: none;
    white-space: nowrap;
}

.lm-auth-dots {
    position: absolute;
    left: 6%;
    top: 22%;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(rgba(var(--a-green-rgb), 0.35) 1.2px, transparent 1.3px);
    background-size: 14px 14px;
    opacity: 0.7;
}

@keyframes aBeam {
    0%, 100% { opacity: 0.35; transform: rotate(18deg) translateY(0); }
    50% { opacity: 0.8; transform: rotate(18deg) translateY(12px); }
}

/* Top bar */
.lm-auth-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0;
}

.lm-auth-logo {
    display: inline-flex;
    text-decoration: none;
}

.lm-auth-logo .lm-brand-mark {
    height: 36px;
    width: auto;
    max-width: min(210px, 60vw);
}

.lm-auth-theme {
    width: 42px;
    height: 42px;
    border: 1px solid var(--a-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--a-sheet) 85%, transparent);
    backdrop-filter: blur(10px);
    color: var(--a-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.lm-auth-theme:hover {
    transform: translateY(-1px);
    border-color: var(--a-green);
    box-shadow: 0 10px 22px rgba(var(--a-green-rgb), 0.16);
}

.lm-auth-theme .fa-sun-o { display: none; }
html[data-theme="dark"] .lm-auth-theme .fa-sun-o { display: inline; }
html[data-theme="dark"] .lm-auth-theme .fa-moon-o { display: none; }

/* Center sheet */
.lm-auth-core {
    position: relative;
    z-index: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0.75rem 1rem 1.25rem;
}

.lm-auth-sheet {
    width: min(100%, 420px);
    max-height: calc(100dvh - 5.5rem);
    overflow: auto;
    border-radius: 28px;
    background: color-mix(in srgb, var(--a-sheet) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--a-line) 80%, transparent);
    box-shadow:
        0 30px 70px rgba(16, 32, 25, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset;
    backdrop-filter: blur(16px);
    animation: aRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html[data-theme="dark"] .lm-auth-sheet {
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

@keyframes aRise {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.lm-auth-sheet-head {
    padding: 1.45rem 1.45rem 0.85rem;
    border-bottom: 1px solid color-mix(in srgb, var(--a-line) 70%, transparent);
    background:
        linear-gradient(180deg, rgba(var(--a-green-rgb), 0.08), transparent 70%);
}

.lm-auth-chip {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.7rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(var(--a-green-rgb), 0.12);
    color: var(--a-green-deep);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.02em;
}

.lm-auth-title {
    margin: 0 0 0.4rem;
    font-family: var(--a-display);
    font-size: clamp(1.85rem, 4.5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.lm-auth-sub {
    margin: 0;
    max-width: 34ch;
    color: var(--a-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.lm-auth-sheet-body {
    padding: 1.15rem 1.45rem 0.35rem;
}

.lm-auth-sheet-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.45rem 1.15rem;
    color: var(--a-muted);
    font-size: 0.74rem;
    font-weight: 650;
}

.lm-auth-sheet-meta span:last-child {
    color: var(--a-green-deep);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.68rem;
}

/* Form controls */
.lm-auth-form {
    display: grid;
    gap: 0.85rem;
}

.lm-auth-field {
    display: grid;
    gap: 0.35rem;
}

.lm-auth-label {
    font-size: 0.8rem;
    font-weight: 750;
}

.lm-auth-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 50px;
    padding: 0 0.9rem;
    border-radius: 14px;
    border: 1.5px solid var(--a-line);
    background: color-mix(in srgb, var(--a-paper) 40%, var(--a-sheet));
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lm-auth-control:focus-within {
    border-color: var(--a-green);
    background: var(--a-sheet);
    box-shadow: 0 0 0 4px rgba(var(--a-green-rgb), 0.14);
}

.lm-auth-control-icon {
    width: 1.1rem;
    color: var(--a-muted);
    text-align: center;
}

.lm-auth-control:focus-within .lm-auth-control-icon {
    color: var(--a-green-deep);
}

.lm-auth-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--a-ink);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 550;
    padding: 0.8rem 0;
}

.lm-auth-input::placeholder {
    color: color-mix(in srgb, var(--a-muted) 78%, transparent);
    font-weight: 500;
}

.lm-auth-input.is-invalid { color: #c62828; }

.lm-auth-eye {
    border: 0;
    background: transparent;
    color: var(--a-muted);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 8px;
}

.lm-auth-eye:hover {
    color: var(--a-green-deep);
    background: rgba(var(--a-green-rgb), 0.1);
}

.lm-auth-field .invalid-feedback {
    display: block;
    font-size: 0.8rem;
    color: #c62828;
}

.lm-auth-row {
    display: flex;
    justify-content: flex-end;
}

.lm-auth-link {
    font-size: 0.86rem;
    font-weight: 750;
    color: var(--a-green-deep);
    text-decoration: none;
}

.lm-auth-link:hover {
    color: var(--a-green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lm-auth-submit {
    width: 100%;
    margin-top: 0.15rem;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #00BC7D, #008F60);
    color: #04110c;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 800;
    padding: 0.9rem 1.05rem;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(var(--a-green-rgb), 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lm-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(var(--a-green-rgb), 0.34);
}

.lm-auth-foot {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.86rem;
    color: var(--a-muted);
}

.lm-auth-alert {
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: rgba(var(--a-green-rgb), 0.12);
    border: 1px solid rgba(var(--a-green-rgb), 0.22);
    font-size: 0.86rem;
}

.lm-auth-copy-block {
    margin: 0 0 1rem;
    color: var(--a-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.lm-auth-copy-block strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--a-ink);
}

@media (max-width: 640px) {
    .lm-auth-sheet {
        border-radius: 22px;
        max-height: calc(100dvh - 4.8rem);
    }

    .lm-auth-sheet-head,
    .lm-auth-sheet-body,
    .lm-auth-sheet-meta {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .lm-auth-mark {
        right: -8%;
        opacity: 0.85;
    }

    .lm-auth-wash {
        inset: 8% 4%;
        border-radius: 24px;
    }
}

/* Very short viewports: allow sheet scroll only */
@media (max-height: 720px) {
    .lm-auth-sheet-head { padding-top: 1.15rem; }
    .lm-auth-title { font-size: 1.75rem; }
    .lm-auth-sub { font-size: 0.9rem; }
    .lm-auth-control { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
    .lm-auth-sheet,
    .lm-auth-beam,
    .lm-auth-submit,
    .lm-auth-theme {
        animation: none !important;
        transition: none !important;
    }
}
