:root {
    --ni-cyan: #12b7df;
    --ni-cyan-dark: #078eb2;
    --ni-blue: #0c5f86;
    --ni-ink: #172033;
    --ni-muted: #667085;
    --ni-line: #d9e4ec;
    --ni-soft: #f4f9fb;
    --ni-white: #ffffff;
    --ni-danger: #b42318;
    --ni-success: #087443;
    --ni-shadow: 0 24px 70px rgba(12, 42, 61, 0.18);
    --ni-shadow-soft: 0 14px 38px rgba(12, 42, 61, 0.12);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    color: var(--ni-ink);
    background: #eaf4f7;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

img,
svg {
    display: block;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.ni-login-page {
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
}

.ni-login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    min-height: calc(100dvh - 92px);
}

.ni-login-brand {
    position: relative;
    display: flex;
    align-items: stretch;
    min-width: 0;
    overflow: hidden;
    color: var(--ni-white);
    background:
        linear-gradient(90deg, rgba(8, 31, 52, 0.92) 0%, rgba(8, 51, 76, 0.78) 42%, rgba(6, 117, 150, 0.42) 100%),
        url("../img/login/laundry-hero.png") center / cover no-repeat;
}

.ni-login-brand::after {
    position: absolute;
    inset: auto 0 0;
    height: 38%;
    content: "";
    background: linear-gradient(0deg, rgba(4, 26, 43, 0.58), rgba(4, 26, 43, 0));
    pointer-events: none;
}

.ni-brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: min(680px, 100%);
    min-height: 100%;
    padding: clamp(32px, 5vw, 70px);
}

.ni-brand-logo {
    width: min(430px, 82%);
    height: auto;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.22));
}

.ni-brand-copy {
    max-width: 620px;
    margin: 70px 0 34px;
}

.ni-brand-copy h1 {
    margin: 0 0 20px;
    font-size: clamp(34px, 4.6vw, 60px);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: 0;
}

.ni-brand-copy p {
    max-width: 540px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(16px, 1.4vw, 20px);
}

.ni-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 780px;
}

.ni-benefit {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(8, 35, 56, 0.42);
    backdrop-filter: blur(10px);
}

.ni-benefit .ni-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    color: #66dcf5;
}

.ni-benefit strong,
.ni-benefit span {
    display: block;
}

.ni-benefit strong {
    margin-bottom: 3px;
    font-size: 15px;
    font-weight: 800;
}

.ni-benefit span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.ni-auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: clamp(24px, 4.5vw, 58px);
    background:
        radial-gradient(circle at 24% 12%, rgba(18, 183, 223, 0.16), transparent 32%),
        linear-gradient(180deg, #f8fcfd 0%, #eef7fa 100%);
}

.ni-mobile-brand {
    display: none;
}

.ni-auth-card {
    width: min(492px, 100%);
    padding: 28px;
    border: 1px solid rgba(12, 95, 134, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--ni-shadow);
}

.ni-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 5px;
    border: 1px solid #dfeaf0;
    border-radius: 999px;
    background: #edf6f9;
}

.ni-tab {
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    color: #496171;
    background: transparent;
    font-weight: 800;
    transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.ni-tab.is-active {
    color: var(--ni-blue);
    background: var(--ni-white);
    box-shadow: 0 8px 20px rgba(12, 95, 134, 0.12);
}

.ni-tab-panel {
    padding-top: 28px;
}

.ni-card-head {
    margin-bottom: 22px;
}

.ni-card-head h2 {
    margin: 0 0 6px;
    color: var(--ni-ink);
    font-size: 30px;
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: 0;
}

.ni-card-head p,
.ni-step-copy {
    margin: 0;
    color: var(--ni-muted);
}

.ni-form {
    display: grid;
    gap: 15px;
}

.ni-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.ni-field label {
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.ni-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.ni-input-wrap .ni-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: #8aa1ad;
    pointer-events: none;
}

.ni-input-wrap input,
.ni-field > input {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #d7e3eb;
    border-radius: 8px;
    color: var(--ni-ink);
    background: #fbfdfe;
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ni-input-wrap input {
    padding-left: 46px;
}

.ni-input-wrap-password input {
    padding-right: 86px;
}

.ni-input-wrap input:focus,
.ni-field > input:focus {
    border-color: var(--ni-cyan);
    background: var(--ni-white);
    box-shadow: 0 0 0 4px rgba(18, 183, 223, 0.14);
}

.ni-password-toggle {
    position: absolute;
    right: 8px;
    min-width: 68px;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    color: var(--ni-blue);
    background: #e8f8fc;
    font-size: 12px;
    font-weight: 800;
}

.ni-form-row,
.ni-form-actions,
.ni-password-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ni-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4a5f6c;
    font-size: 14px;
    font-weight: 700;
}

.ni-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--ni-cyan-dark);
}

.ni-link,
.ni-info-box a,
.ni-register-note a {
    color: var(--ni-blue);
    font-weight: 800;
    text-decoration: none;
}

.ni-link:hover,
.ni-info-box a:hover,
.ni-register-note a:hover {
    text-decoration: underline;
}

.ni-primary-btn,
.ni-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 13px 18px;
    border: 0;
    border-radius: 999px;
    color: var(--ni-white);
    background: linear-gradient(135deg, var(--ni-cyan), var(--ni-blue));
    box-shadow: 0 16px 30px rgba(8, 142, 178, 0.28);
    font-weight: 900;
    letter-spacing: 0;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.ni-secondary-btn {
    background: var(--ni-blue);
    box-shadow: 0 12px 24px rgba(12, 95, 134, 0.22);
}

.ni-primary-btn:hover,
.ni-secondary-btn:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.ni-primary-btn:disabled,
.ni-secondary-btn:disabled,
.ni-inline-btn:disabled {
    cursor: not-allowed;
    filter: grayscale(0.25);
    opacity: 0.65;
    transform: none;
}

.ni-inline-btn {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #cdeaf3;
    border-radius: 999px;
    color: var(--ni-blue);
    background: #effafe;
    font-size: 13px;
    font-weight: 800;
}

.ni-message {
    display: none;
    margin: 0;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 800;
}

.ni-message.is-visible {
    display: block;
}

.ni-message-error {
    color: var(--ni-danger);
    background: #fff2f1;
}

.ni-message-success {
    color: var(--ni-success);
    background: #edfbf4;
}

.ni-message-info {
    color: var(--ni-blue);
    background: #eefaff;
}

.ni-info-box,
.ni-register-note {
    margin-top: 18px;
    padding: 14px 15px;
    border: 1px solid #caeaf4;
    border-radius: 8px;
    color: #425866;
    background: #f0fbfe;
    font-size: 14px;
}

.ni-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0;
}

.ni-stepper span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 999px;
    color: #718897;
    background: #eef4f7;
    font-size: 13px;
    font-weight: 900;
}

.ni-stepper span.is-active,
.ni-stepper span.is-complete {
    color: var(--ni-white);
    background: var(--ni-cyan-dark);
}

.ni-step h3 {
    margin: 0 0 4px;
    color: var(--ni-ink);
    font-size: 18px;
}

.ni-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ni-password-tools {
    align-items: flex-start;
    flex-wrap: wrap;
    color: var(--ni-muted);
    font-size: 13px;
}

.ni-otp-input {
    text-align: center;
    font-size: 24px;
    font-weight: 850;
}

.ni-register-complete {
    padding: 18px;
    border-radius: 8px;
    color: #224a37;
    background: #edfbf4;
}

.ni-register-complete p {
    margin: 0;
}

.ni-login-footer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 92px;
    padding: 18px clamp(20px, 4vw, 54px);
    border-top: 1px solid rgba(12, 95, 134, 0.12);
    color: #4c6170;
    background: var(--ni-white);
    font-size: 13px;
}

.ni-login-footer img {
    width: 190px;
    height: auto;
}

.ni-login-footer address {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0;
    font-style: normal;
}

.ni-login-footer a {
    color: var(--ni-blue);
    font-weight: 800;
    text-decoration: none;
}

.ni-login-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    --ni-loader-progress: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--ni-white);
    background: rgba(14, 27, 39, 0.92);
    opacity: 0;
    transition: opacity 240ms ease, background-color 520ms ease;
}

.ni-login-overlay.is-active {
    opacity: 1;
}

.ni-loader-mark {
    position: relative;
    width: clamp(92px, 9vw, 132px);
    aspect-ratio: 1024 / 752;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.22));
    overflow: hidden;
    transform: translateZ(0) scale(1);
    transform-origin: center;
    transition: transform 680ms cubic-bezier(0.18, 0.82, 0.24, 1), opacity 420ms ease;
    will-change: transform;
}

.ni-loader-mark::before,
.ni-loader-mark::after {
    position: absolute;
    inset: 0;
    content: "";
    background: #f6f8fa;
    -webkit-mask: url("../img/brand/marchietto-noloinvest.png") center / contain no-repeat;
    mask: url("../img/brand/marchietto-noloinvest.png") center / contain no-repeat;
}

.ni-loader-mark::before {
    background: #8b98a3;
    opacity: 0.54;
}

.ni-loader-mark::after {
    transform: scaleY(var(--ni-loader-progress));
    transform-origin: bottom;
    transition: transform 120ms linear;
    will-change: transform;
}

.ni-loader-mark img {
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.ni-login-overlay > span {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.ni-login-overlay.is-complete .ni-loader-mark {
    transform: translateZ(0) scale(12);
}

@media (max-width: 1100px) {
    .ni-login-shell {
        grid-template-columns: minmax(0, 0.95fr) minmax(400px, 1.05fr);
    }

    .ni-benefits {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
}

@media (max-width: 900px) {
    .ni-login-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .ni-login-brand {
        min-height: 330px;
    }

    .ni-brand-content {
        min-height: 330px;
        padding: 24px;
    }

    .ni-brand-logo {
        width: min(330px, 78%);
    }

    .ni-brand-copy {
        margin: 34px 0 0;
    }

    .ni-brand-copy h1 {
        max-width: 560px;
        font-size: 34px;
    }

    .ni-brand-copy p {
        max-width: 520px;
        font-size: 16px;
    }

    .ni-benefits {
        display: none;
    }

    .ni-auth-panel {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .ni-login-brand {
        min-height: 246px;
    }

    .ni-brand-content {
        min-height: 246px;
        padding: 20px;
    }

    .ni-brand-logo {
        width: min(280px, 82%);
    }

    .ni-brand-copy {
        margin-top: 22px;
    }

    .ni-brand-copy h1 {
        font-size: 27px;
    }

    .ni-brand-copy p {
        display: none;
    }

    .ni-auth-panel {
        padding: 18px;
    }

    .ni-auth-card {
        padding: 20px;
        box-shadow: var(--ni-shadow-soft);
    }

    .ni-card-head h2 {
        font-size: 26px;
    }

    .ni-grid-2 {
        grid-template-columns: 1fr;
    }

    .ni-form-row,
    .ni-form-actions,
    .ni-password-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .ni-form-row {
        gap: 10px;
    }

    .ni-link {
        align-self: flex-start;
    }

    .ni-inline-btn,
    .ni-primary-btn,
    .ni-secondary-btn {
        width: 100%;
    }

    .ni-login-footer {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 10px;
        padding: 18px;
        text-align: center;
    }

    .ni-login-footer img {
        width: 142px;
    }

    .ni-login-footer address {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .ni-auth-panel {
        padding: 12px;
    }

    .ni-auth-card {
        padding: 16px;
    }

    .ni-tab-panel {
        padding-top: 22px;
    }

    .ni-input-wrap-password input {
        padding-right: 78px;
    }

    .ni-password-toggle {
        min-width: 62px;
        padding: 0 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }

    .ni-login-overlay.is-complete .ni-loader-mark {
        opacity: 1;
        transform: scale(1);
    }
}
