:root {
    --nf-green-50: #ecfdf3;
    --nf-green-100: #d9f7e3;
    --nf-green-500: #22a55e;
    --nf-green-600: #16a34a;
    --nf-green-700: #0f7a3d;
    --nf-navy-900: #0a1c38;
    --nf-teal-700: #0d9488;
    --nf-text: #10203a;
    --nf-text-muted: #5b6b84;
    --nf-text-soft: #8592a6;
    --nf-border: #e6ebf1;
    --nf-bg: #ffffff;
    --nf-bg-soft: #f6f9fb;
    --nf-radius-sm: 8px;
    --nf-radius-md: 12px;
    --nf-radius-lg: 20px;
    --nf-radius-pill: 999px;
    --nf-shadow-md: 0 8px 24px rgba(16, 32, 58, 0.08);
    --nf-shadow-lg: 0 24px 60px rgba(16, 32, 58, 0.14);
    --nf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    font-family: var(--nf-font);
    color: var(--nf-text);
    background: var(--nf-bg-soft);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

/* ── Page shell ── */
.auth-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #f7faf8 0%, #eefcf3 45%, #f6fff0 100%);
}

.auth-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(34, 165, 94, 0.14) 1.5px, transparent 1.5px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 82% 12%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse 60% 55% at 82% 12%, #000 0%, transparent 70%);
    pointer-events: none;
}

.auth-stage {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 40px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 65px 40px 64px;
    min-height: calc(100vh - 102px);
}

/* ── Left: headline + illustration ── */
.auth-illustration {
    padding-right: 16px;
}

.auth-illustration h1 {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.18;
    color: var(--nf-navy-900);
    margin: 0 0 16px;
}

.auth-illustration h1 .accent {
    color: var(--nf-green-600);
}

.auth-illustration > p {
    font-size: 15px;
    color: var(--nf-text-muted);
    line-height: 1.65;
    max-width: 400px;
    margin: 0 0 8px;
}

.auth-illustration__img {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin-top: 8px;
}

/* ── Right: floating card ── */
.auth-card {
    position: relative;
    background: var(--nf-bg);
    border-radius: var(--nf-radius-lg);
    box-shadow: var(--nf-shadow-lg);
    padding: 56px 40px 20px;
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
}

.auth-card__badge {
    position: absolute;
    top: -34px;
    left: 50%;
    transform: translateX(-50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--nf-shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card__badge span {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nf-green-500), var(--nf-teal-700));
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card__badge svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.auth-card h1.card-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--nf-navy-900);
    margin: 0 0 6px;
}

.auth-card__sub {
    text-align: center;
    font-size: 13.5px;
    color: var(--nf-text-muted);
    margin: 0 0 26px;
}

.auth-card__sub a {
    color: var(--nf-green-600);
    font-weight: 600;
    text-decoration: none;
}

.auth-card__sub a:hover {
    text-decoration: underline;
}

/* ── Alerts (unchanged behaviour, restyled) ── */
.esign-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 15px;
    border-radius: var(--nf-radius-sm);
    border: 1.5px solid transparent;
    margin-bottom: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    animation: alertSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.esign-alert-success {
    background: var(--nf-green-50);
    border-color: var(--nf-green-100);
    color: #14532D;
}

.esign-alert-success .esign-alert-icon {
    background: #DCFCE7;
    color: var(--nf-green-700);
}

.esign-alert-error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #7F1D1D;
}

.esign-alert-error .esign-alert-icon {
    background: #FEE2E2;
    color: #DC2626;
}

.esign-alert-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.esign-alert-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 1px;
}

.esign-alert-title {
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.esign-alert-msg {
    font-size: 13.5px;
    opacity: 0.9;
}

.esign-alert-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    opacity: 0.45;
    color: inherit;
    flex-shrink: 0;
    line-height: 1;
    transition: opacity 0.15s;
    margin-top: 2px;
}

.esign-alert-close:hover {
    opacity: 1;
}

/* ── Form fields ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--nf-navy-900);
    margin-bottom: 7px;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nf-text-soft);
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    box-sizing: border-box;
    border-radius: var(--nf-radius-sm);
    border: 1.5px solid var(--nf-border);
    font-size: 14px;
    font-family: inherit;
    color: var(--nf-text);
    background: var(--nf-bg-soft);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.input-with-icon .form-input {
    padding-left: 42px;
    padding-right: 42px;
}

.form-input::placeholder {
    color: var(--nf-text-soft);
}

.form-input:focus {
    border-color: var(--nf-green-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 165, 94, 0.12);
}

.form-input.is-invalid {
    border-color: #DC2626;
}

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--nf-text-soft);
}

.toggle-pw:hover {
    color: var(--nf-green-600);
}

.toggle-pw svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    fill: none;
}

.invalid-feedback {
    display: block;
    font-size: 12px;
    margin-top: 6px;
}

/* .invalid-feedback's own display:block (author CSS) beats the browser's
   default [hidden] { display:none } (UA CSS) at equal specificity — this
   compound selector restores it, so the hidden attribute actually hides
   the element (same fix already applied to .btn-oauth[hidden]). */
.invalid-feedback[hidden] {
    display: none;
}

.phone-error-msg {
    color: #DC2626;
}

/* ── Consent ── */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 22px;
}

.form-checkbox input {
    margin-top: 3px;
    accent-color: var(--nf-green-600);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.form-checkbox label {
    font-size: 12.5px;
    color: var(--nf-text-muted);
    line-height: 1.5;
}

.form-checkbox label a {
    color: var(--nf-green-600);
    font-weight: 600;
    text-decoration: none;
}

.form-checkbox label a:hover {
    text-decoration: underline;
}

/* ── Buttons ── */
.btn-form-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    border-radius: var(--nf-radius-sm);
    background: linear-gradient(135deg, var(--nf-green-500), var(--nf-teal-700));
    color: #fff !important;
    border: none;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(34, 165, 94, 0.3);
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn-form-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(34, 165, 94, 0.36);
}

.divider-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}

.divider-or::before, .divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--nf-border);
}

.divider-or span {
    font-size: 12px;
    color: var(--nf-text-soft);
}

.btn-oauth {
    width: 100%;
    padding: 11px;
    border-radius: var(--nf-radius-sm);
    border: 1.5px solid var(--nf-border);
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--nf-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-oauth[hidden] {
    display: none;
}

.btn-oauth:hover {
    border-color: var(--nf-green-500);
    background: var(--nf-green-50);
}

.google-btn-container {
    display: flex;
    justify-content: center;
    min-height: 44px;
    margin-bottom: 4px;
}

.google-fallback-btn {
    margin-bottom: 4px;
}

/* ── Trust row + footer ── */
.signup-trust-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.signup-trust-item {
    font-size: 11.5px;
    color: var(--nf-text-soft);
    display: flex;
    align-items: center;
    gap: 4px;
}

.signup-trust-item .check {
    color: var(--nf-green-600);
    font-weight: 700;
}

.auth-card__foot {
    text-align: center;
    font-size: 13.5px;
    color: var(--nf-text-muted);
    margin-top: 18px;
}

.auth-card__foot a {
    color: var(--nf-green-600);
    font-weight: 700;
    text-decoration: none;
}

.auth-card__foot a:hover {
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .auth-illustration {
        display: none;
    }

    .auth-stage {
        grid-template-columns: 1fr;
        padding: 16px 24px 48px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 52px 22px 30px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
