/*
 * Sign-in, forgot-password and other signed-out pages.
 *
 * Plain CSS rather than Tailwind utilities on purpose: these pages must look
 * right even when app.css has not been rebuilt, and they share nothing with
 * the signed-in shell except the font loading.
 */

:root {
    --nx-page:        #F4F6F9;
    --nx-card:        #FFFFFF;
    --nx-text:        #000000;
    --nx-text-soft:   #333333;
    --nx-muted:       #626262;
    --nx-faint:       #8A8A8A;
    --nx-line:        #DDDDDD;
    --nx-line-faint:  #EBEBEB;
    --nx-brand:       #159AFF;   /* logo, focus, illustration */
    --nx-action:      #0A78D4;   /* buttons and links: white text reads on it */
    --nx-action-deep: #075FA8;
    --nx-danger:      #D0342C;
    --nx-danger-soft: #FDF1F0;
    --nx-ok:          #1E7F4F;
    --nx-ok-soft:     #EEF8F2;
    --nx-warn:        #8A5A00;
    --nx-warn-soft:   #FFF6E0;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.nx-auth {
    margin: 0;
    min-height: 100%;
    background: var(--nx-page);
    color: var(--nx-text);
    font-family: Lato, 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 40px 16px;
}

.nx-auth a { color: var(--nx-action); text-decoration: none; font-weight: 700; }
.nx-auth a:hover { color: var(--nx-action-deep); text-decoration: underline; }

/* ------------------------------------------------------------------ card */

.nx-card {
    width: 100%;
    max-width: 1000px;
    min-height: 580px;
    display: flex;
    background: var(--nx-card);
    border-radius: 4px;
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

.nx-form-side {
    flex: 1 1 50%;
    padding: 52px 56px 44px;
    display: flex;
    flex-direction: column;
}

.nx-divider {
    width: 1px;
    background: var(--nx-line-faint);
    margin: 44px 0;
}

.nx-art-side {
    flex: 1 1 50%;
    padding: 52px 56px 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (max-width: 860px) {
    .nx-divider, .nx-art-side { display: none; }
    .nx-form-side { padding: 40px 28px 32px; }
    .nx-card { min-height: 0; max-width: 480px; }
}

/* ------------------------------------------------------------------ brand */

.nx-brand { display: flex; align-items: center; gap: 10px; color: var(--nx-text); }
.nx-auth a.nx-brand,
.nx-auth a.nx-brand:hover { text-decoration: none; color: var(--nx-text); }

.nx-brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--nx-brand);
    display: flex; align-items: center; justify-content: center;
}

.nx-brand-name { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.nx-brand-accent { color: #1E6FD9; }
.nx-brand svg { flex-shrink: 0; display: block; }

/* ------------------------------------------------------------------ copy */

.nx-title { margin: 40px 0 0; font-size: 24px; font-weight: 700; }
.nx-subtitle { margin: 6px 0 0; font-size: 15px; color: var(--nx-muted); line-height: 1.5; }

/* ------------------------------------------------------------------ form */

.nx-form { margin-top: 30px; display: flex; flex-direction: column; gap: 22px; }

.nx-field { display: flex; flex-direction: column; gap: 7px; }
.nx-field-head { display: flex; justify-content: space-between; align-items: baseline; }
.nx-label { font-size: 13px; font-weight: 700; color: var(--nx-text-soft); }
.nx-field-head a { font-size: 13px; }

.nx-input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--nx-line);
    border-radius: 4px;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    color: var(--nx-text);
    background: #FFFFFF;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.nx-input:focus { border-color: var(--nx-brand); box-shadow: 0 0 0 3px rgba(21, 154, 255, 0.15); }
.nx-input.input-validation-error { border-color: var(--nx-danger); }

.nx-password { position: relative; display: flex; }
.nx-password .nx-input { padding-right: 48px; }
.nx-eye {
    position: absolute; right: 4px; top: 4px;
    width: 38px; height: 38px;
    border: 0; background: transparent; color: var(--nx-faint);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 4px;
}
.nx-eye:hover { color: var(--nx-text); }

.nx-error { font-size: 12.5px; color: var(--nx-danger); }
.nx-error:empty { display: none; }

.nx-check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--nx-text-soft); }
.nx-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--nx-action); }

.nx-button {
    height: 46px;
    width: 100%;
    border: 0;
    border-radius: 4px;
    background: var(--nx-action);
    color: #FFFFFF;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.nx-button:hover { background: var(--nx-action-deep); }
.nx-button:focus-visible { outline: 3px solid rgba(21, 154, 255, 0.35); outline-offset: 2px; }

.nx-button-quiet {
    background: transparent; color: var(--nx-action); border: 1px solid var(--nx-line);
}
.nx-button-quiet:hover { background: #F5F9FD; color: var(--nx-action-deep); }
.nx-auth a.nx-button, .nx-auth a.nx-button:hover { text-decoration: none; color: #FFFFFF; }
.nx-auth a.nx-button-quiet, .nx-auth a.nx-button-quiet:hover { color: var(--nx-action); }

.nx-center-link { align-self: center; font-size: 14px; }

/* A one-click next step under a field error ("Create an account"). */
.nx-field-hint { font-size: 13.5px; font-weight: 700; align-self: flex-start; }

/*
 * Development only: the code itself, when no mail server is set up. Dashed
 * and labelled so nobody mistakes it for part of the real product.
 */
.nx-devcode {
    margin-top: 22px; padding: 12px 14px; border-radius: 4px;
    border: 1px dashed rgba(138, 90, 0, 0.55); background: var(--nx-warn-soft); color: var(--nx-warn);
    font-size: 13.5px; line-height: 1.5;
}
.nx-devcode-code {
    display: inline-block; margin-top: 6px;
    font: 800 22px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .28em;
    color: var(--nx-text); user-select: all;
}

/* ------------------------------------------------------------------ alerts */

.nx-alert {
    margin-top: 22px;
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 13.5px;
    line-height: 1.5;
}
.nx-alert ul { margin: 0; padding-left: 18px; }
.nx-alert-danger { background: var(--nx-danger-soft); color: var(--nx-danger); border: 1px solid rgba(208, 52, 44, 0.25); }
.nx-alert-ok     { background: var(--nx-ok-soft); color: var(--nx-ok); border: 1px solid rgba(30, 127, 79, 0.25); }
.nx-alert-warn   { background: var(--nx-warn-soft); color: var(--nx-warn); border: 1px solid rgba(138, 90, 0, 0.25); }
.nx-alert:empty, .validation-summary-valid.nx-alert { display: none; }

/* ------------------------------------------------------------------ foot */

.nx-grow { flex-grow: 1; min-height: 24px; }
.nx-foot { border-top: 1px solid #E6E6E6; padding-top: 14px; font-size: 14px; color: var(--nx-muted); margin: 0; }

.nx-copyright { margin: 0; font-size: 12.5px; color: var(--nx-faint); }

/* ------------------------------------------------------------------ slides */

.nx-slide { display: none; flex-direction: column; align-items: center; }
.nx-slide.is-current { display: flex; animation: nx-fade .35s ease; }
.nx-slide h2 { margin: 22px 0 0; font-size: 20px; font-weight: 700; }
.nx-slide p  { margin: 10px 0 0; max-width: 340px; font-size: 14.5px; line-height: 1.6; color: var(--nx-muted); }

.nx-dots { margin-top: 28px; display: flex; gap: 4px; align-items: center; }
.nx-dot {
    width: 22px; height: 22px; padding: 0; border: 0; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.nx-dot::before {
    content: ''; display: block; width: 6px; height: 6px; border-radius: 3px;
    background: #D5DEE8; transition: width .2s, background .2s;
}
.nx-dot.is-current::before { width: 20px; background: var(--nx-brand); }

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

@media (prefers-reduced-motion: reduce) {
    .nx-slide.is-current { animation: none; }
    .nx-dot::before, .nx-input { transition: none; }
}

/* ------------------------------------------------------------ email codes */

.nx-strong { color: var(--nx-text); font-weight: 700; overflow-wrap: anywhere; }
.nx-muted { color: var(--nx-muted); }
.nx-fine { margin: -6px 0 0; font-size: 13px; color: var(--nx-muted); text-align: center; }

.nx-button svg { margin-right: 8px; flex-shrink: 0; }

/* The live demo, under the sign-in form: a quieter second choice. */
.nx-or {
    margin: 24px 0 0; display: flex; align-items: center; gap: 14px;
    font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--nx-faint);
}
.nx-or::before, .nx-or::after { content: ''; flex: 1; height: 1px; background: var(--nx-line-faint); }
.nx-demo { margin-top: 20px; display: flex; flex-direction: column; gap: 22px; }
.nx-button-demo {
    background: #FFFFFF; color: var(--nx-action); border: 1px solid var(--nx-action);
    transition: background .15s, color .15s;
}
.nx-button-demo:hover { background: var(--nx-action); color: #FFFFFF; }
.nx-button-demo svg { fill: currentColor; stroke: none; width: 13px; height: 13px; }


/* Six boxes. Script swaps the plain field for them. */
.nx-otp { display: flex; gap: 10px; }
.nx-otp[hidden] { display: none; }
.nx-otp-box {
    width: 100%; max-width: 52px; height: 56px; min-width: 0;
    border: 1px solid var(--nx-line); border-radius: 6px;
    text-align: center; font: inherit; font-size: 24px; font-weight: 700; color: var(--nx-text);
    background: #FFFFFF; outline: none; caret-color: var(--nx-brand);
    transition: border-color .12s, box-shadow .12s;
}
.nx-otp-box:focus { border-color: var(--nx-brand); box-shadow: 0 0 0 3px rgba(21, 154, 255, 0.15); }
.nx-otp-box.is-filled { border-color: #9CC6FF; background: #F7FBFF; }
.nx-otp.is-error .nx-otp-box { border-color: var(--nx-danger); }
.nx-otp-ready .nx-otp-plain { display: none; }
.nx-otp-plain { letter-spacing: .4em; font-size: 20px; font-weight: 700; }

.nx-otp-foot { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; font-size: 13.5px; text-align: center; }
.nx-linkbutton {
    border: 0; background: none; padding: 0; margin-left: 4px; cursor: pointer;
    font: inherit; font-weight: 700; color: var(--nx-action);
}
.nx-linkbutton:hover { text-decoration: underline; }
.nx-linkbutton:disabled { color: var(--nx-faint); cursor: default; text-decoration: none; }

/* Password strength */
.nx-strength { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--nx-muted); }
.nx-strength-bar { display: flex; gap: 4px; flex-shrink: 0; }
.nx-strength-bar i { width: 26px; height: 4px; border-radius: 2px; background: var(--nx-line-faint); }
.nx-strength[data-level="1"] .nx-strength-bar i:nth-child(-n+1) { background: var(--nx-danger); }
.nx-strength[data-level="2"] .nx-strength-bar i:nth-child(-n+2) { background: #E6A23C; }
.nx-strength[data-level="3"] .nx-strength-bar i:nth-child(-n+3) { background: #4CAF50; }
.nx-strength[data-level="4"] .nx-strength-bar i:nth-child(-n+4) { background: var(--nx-ok); }

.nx-check-top { align-items: flex-start; }
.nx-check-top input { margin-top: 2px; }

@media (max-width: 420px) {
    .nx-otp { gap: 6px; }
    .nx-otp-box { height: 50px; font-size: 21px; }
}
