/* Nidaam auth — super + workspace login
   Ink / teal / Sora / Manrope — matches landing brand. */

:root {
    --nm-ink: #08111f;
    --nm-ink-2: #122033;
    --nm-mist: #eef2f6;
    --nm-paper: #f7f9fc;
    --nm-line: rgba(8, 17, 31, 0.1);
    --nm-muted: #5b6b7c;
    --nm-teal: #1ecad3;
    --nm-teal-deep: #0e8f97;
    --nm-amber: #f0a05a;
    --nm-white: #ffffff;
    --nm-font: 'Manrope', system-ui, sans-serif;
    --nm-display: 'Sora', 'Manrope', system-ui, sans-serif;
    --nm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body.nm-auth {
    font-family: var(--nm-font);
    color: var(--nm-ink);
    background: var(--nm-paper);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 100svh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }

/* ── Hero ───────────────────────────────────────────────── */
.nm-auth__hero {
    position: relative;
    overflow: hidden;
    color: var(--nm-white);
    background:
        radial-gradient(80% 60% at 70% 20%, rgba(30,202,211,.28), transparent 55%),
        radial-gradient(60% 50% at 15% 85%, rgba(240,160,90,.14), transparent 50%),
        linear-gradient(160deg, #050a14 0%, #0c1a2e 45%, #10253d 100%);
    display: none;
    align-items: center;
    padding: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 1024px) {
    .nm-auth__hero { display: flex; }
}

.nm-auth__aurora {
    position: absolute;
    inset: -20% -10% auto;
    height: 70%;
    background: conic-gradient(from 210deg at 65% 40%, rgba(30,202,211,.2), transparent 30%, rgba(240,160,90,.12), transparent 60%);
    filter: blur(40px);
    animation: nm-auth-aurora 16s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes nm-auth-aurora {
    from { transform: translate3d(-2%, 0, 0) scale(1); }
    to { transform: translate3d(3%, 4%, 0) scale(1.08); }
}

.nm-auth__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 45%, #000 15%, transparent 72%);
    pointer-events: none;
}

.nm-auth__orbit {
    position: absolute;
    left: 58%;
    top: 42%;
    width: min(52vw, 380px);
    height: min(52vw, 380px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(30,202,211,.18);
    animation: nm-auth-spin 28s linear infinite;
    pointer-events: none;
}
.nm-auth__orbit--2 {
    width: min(68vw, 520px);
    height: min(68vw, 520px);
    border-color: rgba(240,160,90,.12);
    animation-duration: 40s;
    animation-direction: reverse;
}
.nm-auth__orbit::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--nm-teal);
    box-shadow: 0 0 0 4px rgba(30,202,211,.15);
}
.nm-auth__orbit--2::before { background: var(--nm-amber); }
@keyframes nm-auth-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.nm-auth__nodes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.nm-auth__node {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    padding: .32rem .62rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(8,17,31,.45);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,.7);
    font-size: .72rem;
    font-weight: 700;
    opacity: 0;
    animation: nm-auth-node .7s var(--nm-ease) forwards;
    animation-delay: calc(.4s + var(--d) * .1s);
}
.nm-auth__node.is-live {
    border-color: rgba(30,202,211,.55);
    color: #fff;
    background: rgba(30,202,211,.14);
    box-shadow: 0 0 0 5px rgba(30,202,211,.1);
}
@keyframes nm-auth-node {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.75); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.nm-auth__hero-inner {
    position: relative;
    z-index: 2;
    max-width: 28rem;
}

.nm-auth__kicker {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 1.1rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--nm-teal);
}
.nm-auth__kicker::before {
    content: '';
    width: 1.35rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.nm-auth__hero-inner h1 {
    font-family: var(--nm-display);
    font-size: clamp(1.85rem, 3.2vw, 2.55rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin: 0 0 .85rem;
}

.nm-auth__hero-inner p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.65;
    color: rgba(238,242,246,.72);
}

.nm-auth__pills {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.75rem;
}
.nm-auth__pills span {
    padding: .4rem .75rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.05);
    font-size: .78rem;
    font-weight: 700;
    color: rgba(255,255,255,.75);
}

/* ── Panel ──────────────────────────────────────────────── */
.nm-auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background:
        radial-gradient(50% 40% at 100% 0%, rgba(30,202,211,.08), transparent 55%),
        var(--nm-paper);
}

.nm-auth__card {
    width: min(100%, 420px);
    animation: nm-auth-rise .7s var(--nm-ease) both;
}
@keyframes nm-auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.nm-auth__brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: 1.75rem;
    font-family: var(--nm-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    color: var(--nm-ink);
}
.nm-auth__brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--nm-ink);
    color: var(--nm-teal);
    font-weight: 700;
    border: 1px solid rgba(30,202,211,.25);
}
.nm-auth__brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nm-auth__heading h2 {
    font-family: var(--nm-display);
    font-size: clamp(1.55rem, 3vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin: 0 0 .45rem;
}
.nm-auth__heading p {
    margin: 0 0 1.4rem;
    color: var(--nm-muted);
    font-size: .95rem;
    line-height: 1.55;
}

.nm-auth__alert {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .85rem 1rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-size: .9rem;
    line-height: 1.45;
    border: 1px solid rgba(220, 80, 80, .25);
    background: rgba(220, 80, 80, .08);
    color: #9b1c1c;
}
.nm-auth__alert--ok {
    border-color: rgba(14,143,151,.3);
    background: rgba(30,202,211,.1);
    color: #0e5f66;
}
.nm-auth__alert svg {
    width: 18px;
    height: 18px;
    flex: none;
    stroke: currentColor;
    margin-top: .1rem;
}

.nm-auth__group { margin-bottom: 1rem; }
.nm-auth__group label {
    display: block;
    margin-bottom: .4rem;
    font-size: .82rem;
    font-weight: 700;
    color: var(--nm-ink-2);
}

.nm-auth__field {
    position: relative;
    display: flex;
    align-items: center;
}
.nm-auth__field input {
    width: 100%;
    border: 1px solid var(--nm-line);
    border-radius: 14px;
    background: var(--nm-white);
    padding: .9rem 2.75rem .9rem 1rem;
    font-size: .95rem;
    color: var(--nm-ink);
    transition: border-color .25s, box-shadow .25s;
}
.nm-auth__field input::placeholder { color: #9aa7b5; }
.nm-auth__field input:focus {
    outline: none;
    border-color: rgba(30,202,211,.55);
    box-shadow: 0 0 0 4px rgba(30,202,211,.12);
}
.nm-auth__field input.is-invalid {
    border-color: rgba(220, 80, 80, .45);
}
.nm-auth__field-ico {
    position: absolute;
    right: .95rem;
    width: 18px;
    height: 18px;
    stroke: var(--nm-muted);
    pointer-events: none;
}
.nm-auth__toggle {
    position: absolute;
    right: .55rem;
    border: 0;
    background: transparent;
    padding: .4rem;
    cursor: pointer;
    color: var(--nm-muted);
    display: grid;
    place-items: center;
}
.nm-auth__toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.nm-auth__toggle:hover { color: var(--nm-teal-deep); }
.nm-auth__field:has(.nm-auth__toggle) input { padding-right: 2.8rem; }
.nm-auth__field:has(.nm-auth__toggle) .nm-auth__field-ico { display: none; }

.nm-auth__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    margin: .25rem 0 1.25rem;
    font-size: .85rem;
}
.nm-auth__remember {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--nm-muted);
    cursor: pointer;
}
.nm-auth__remember input { accent-color: var(--nm-teal-deep); }
.nm-auth__forgot {
    color: var(--nm-teal-deep);
    font-weight: 700;
}
.nm-auth__forgot:hover { text-decoration: underline; }

.nm-auth__submit {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: .95rem 1.2rem;
    background: linear-gradient(120deg, var(--nm-teal-deep), var(--nm-teal));
    color: #042028;
    font-weight: 700;
    font-size: .98rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    position: relative;
    overflow: hidden;
    transition: transform .25s, filter .25s, box-shadow .25s;
    box-shadow: 0 14px 30px -16px rgba(14,143,151,.7);
}
.nm-auth__submit:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}
.nm-auth__submit:disabled { opacity: .75; cursor: wait; }
.nm-auth__submit svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.nm-auth__submit .nm-auth__spin {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(4,32,40,.25);
    border-top-color: #042028;
    border-radius: 50%;
    animation: nm-auth-spin-btn .65s linear infinite;
}
.nm-auth__submit.is-loading .nm-auth__btn-text,
.nm-auth__submit.is-loading .nm-auth__btn-arrow { display: none; }
.nm-auth__submit.is-loading .nm-auth__spin { display: inline-block; }
@keyframes nm-auth-spin-btn { to { transform: rotate(360deg); } }

.nm-auth__divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
    color: var(--nm-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.nm-auth__divider::before,
.nm-auth__divider::after {
    content: '';
    height: 1px;
    background: var(--nm-line);
}

.nm-auth__alt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .85rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--nm-line);
    background: var(--nm-white);
    font-weight: 700;
    font-size: .92rem;
    color: var(--nm-ink);
    transition: border-color .25s, background .25s;
}
.nm-auth__alt:hover {
    border-color: rgba(30,202,211,.45);
    background: rgba(30,202,211,.06);
}
.nm-auth__alt svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.nm-auth__foot {
    margin-top: 1.75rem;
    text-align: center;
    font-size: .78rem;
    color: var(--nm-muted);
}

@media (max-width: 1023px) {
    body.nm-auth { grid-template-columns: 1fr; }
    .nm-auth__panel {
        min-height: 100svh;
        background:
            radial-gradient(70% 40% at 50% 0%, rgba(30,202,211,.12), transparent 55%),
            linear-gradient(180deg, #0c1a2e 0%, #10253d 28%, var(--nm-paper) 28%);
        padding-top: 2.5rem;
    }
    .nm-auth__brand { color: #fff; }
    .nm-auth__card {
        background: var(--nm-white);
        border-radius: 22px;
        padding: 1.5rem 1.25rem 1.35rem;
        border: 1px solid var(--nm-line);
        box-shadow: 0 28px 60px -40px rgba(8,17,31,.45);
    }
    .nm-auth__brand { color: var(--nm-ink); margin-bottom: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .nm-auth__aurora,
    .nm-auth__orbit,
    .nm-auth__node,
    .nm-auth__card,
    .nm-auth__submit .nm-auth__spin { animation: none !important; }
    .nm-auth__node { opacity: .85; }
    .nm-auth__card { opacity: 1; transform: none; }
}
