/* ============================================
   nFinance Form - Modern UI
   כל הסלקטורים מתחילים ב-.nff-app כדי לא להתנגש
   עם סגנונות תבנית ולתמוך בריבוי מופעים
   ============================================ */

.nff-app {
    direction: rtl;
    font-family: "Rubik", "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px;
    color: #111827;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

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

/* --- Progress bar --- */
.nff-app .nff-meter {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 32px;
}

.nff-app .nff-meter-bar {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 999px;
    transition: width 700ms cubic-bezier(.22, 1, .36, 1);
}

/* --- Main card --- */
.nff-app .nff-block {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow:
        0 1px 3px rgba(17, 24, 39, 0.04),
        0 10px 30px -12px rgba(17, 24, 39, 0.08);
    border: 1px solid rgba(17, 24, 39, 0.05);
    position: relative;
    overflow: hidden;
}

/* --- Step transition animation --- */
.nff-app .nff-step {
    animation: nff-step-in 450ms cubic-bezier(.22, 1, .36, 1);
}

@keyframes nff-step-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Title --- */
.nff-app .nff-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 28px;
    line-height: 1.45;
    color: #111827;
    text-align: center;
    letter-spacing: -0.01em;
}

/* --- Text input --- */
.nff-app .nff-field {
    max-width: 420px;
    margin: 0 auto;
}

.nff-app .nff-input {
    width: 100%;
    padding: 18px 22px;
    font-size: 19px;
    font-weight: 500;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
    transition: border-color 180ms, background 180ms, box-shadow 180ms;
    font-family: inherit;
    text-align: center;
    color: #111827;
    letter-spacing: 0.01em;
}

.nff-app .nff-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.nff-app .nff-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.nff-app .nff-input.nff-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.nff-app .nff-input.nff-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

/* --- Options grid --- */
.nff-app .nff-options {
    display: grid;
    gap: 14px;
}

/* 2 columns by default on mobile */
.nff-app .nff-options-2,
.nff-app .nff-options-3,
.nff-app .nff-options-4 {
    grid-template-columns: repeat(2, 1fr);
}

/* Above 560px */
@media (min-width: 560px) {
    .nff-app .nff-options-2 { grid-template-columns: repeat(2, 1fr); max-width: 460px; margin-left: auto; margin-right: auto; }
    .nff-app .nff-options-3 { grid-template-columns: repeat(3, 1fr); }
    .nff-app .nff-options-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Option card --- */
.nff-app .nff-option {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 10px 10px 14px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 200ms, transform 200ms, box-shadow 200ms, background 200ms;
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nff-app .nff-option-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}

.nff-app .nff-option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms ease;
}

.nff-app .nff-option-text {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    padding: 14px 4px 0;
    line-height: 1.3;
}

.nff-app .nff-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Hover */
@media (hover: hover) {
    .nff-app .nff-option:hover {
        border-color: #93c5fd;
        transform: translateY(-3px);
        box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.22);
    }
    .nff-app .nff-option:hover .nff-option-image img {
        transform: scale(1.05);
    }
}

/* Selected state */
.nff-app .nff-option.nff-selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 10px 24px -8px rgba(37, 99, 235, 0.28);
}

.nff-app .nff-option.nff-selected .nff-option-text {
    color: #1e40af;
    font-weight: 600;
}

/* Check mark on selected */
.nff-app .nff-option.nff-selected::after {
    content: '';
    position: absolute;
    top: 16px;
    inset-inline-start: 16px;
    width: 28px;
    height: 28px;
    background-color: #2563eb;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8 6.5 11.5 13 4.5'/%3E%3C/svg%3E");
    background-size: 18px;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.4);
    z-index: 2;
    animation: nff-check-pop 300ms ease;
}

@keyframes nff-check-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

/* --- Error messages --- */
.nff-app .nff-err {
    display: none;
    color: #b91c1c;
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    padding: 12px 16px;
    background: #fef2f2;
    border-radius: 10px;
    border: 1px solid #fecaca;
    font-weight: 500;
    line-height: 1.4;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.nff-app .nff-err-global { margin-top: 16px; }

/* --- Honeypots (hidden) --- */
.nff-app .nff-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    height: 0;
    width: 0;
    overflow: hidden;
    visibility: hidden;
}

/* --- Consent text/checkbox --- */
.nff-app .nff-consent {
    max-width: 480px;
    margin: 18px auto 0;
    text-align: center;
}

.nff-app .nff-consent-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.nff-app .nff-consent-text a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

.nff-app .nff-consent-text a:hover {
    color: #1d4ed8;
}

.nff-app .nff-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    text-align: start;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color 150ms, background 150ms;
}

.nff-app .nff-consent-checkbox:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.nff-app .nff-consent-checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

.nff-app .nff-consent-checkbox .nff-consent-text {
    text-align: start;
    font-size: 13px;
}

/* --- Buttons --- */
.nff-app .nff-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    gap: 12px;
}

.nff-app .nff-btn {
    padding: 16px 32px;
    font-size: 17px;
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: background 180ms, transform 120ms, box-shadow 180ms, color 180ms;
    line-height: 1;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nff-app .nff-btn-arrow {
    font-size: 18px;
    opacity: 0.85;
    transition: transform 180ms;
}

.nff-app .nff-btn-next,
.nff-app .nff-btn-submit {
    background: #2563eb;
    color: #ffffff;
    margin-inline-start: auto;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nff-app .nff-btn-next:hover,
.nff-app .nff-btn-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.nff-app .nff-btn-next:hover .nff-btn-arrow {
    transform: translateX(-4px);
}

.nff-app .nff-btn-next:active,
.nff-app .nff-btn-submit:active {
    transform: translateY(0);
}

.nff-app .nff-btn-back {
    background: #f3f4f6;
    color: #4b5563;
    padding: 14px 22px;
    font-size: 15px;
    box-shadow: none;
}

.nff-app .nff-btn-back:hover {
    background: #e5e7eb;
    color: #111827;
}

.nff-app .nff-btn-back:hover .nff-btn-arrow {
    transform: translateX(4px);
}

.nff-app .nff-btn:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Loading state (subtle pulse while starting session) --- */
.nff-app.nff-loading .nff-block {
    opacity: 0.6;
    pointer-events: none;
}

/* --- Mobile --- */
@media (max-width: 560px) {
    .nff-app {
        padding: 12px 10px;
    }
    .nff-app .nff-block {
        padding: 24px 18px;
        border-radius: 16px;
    }
    .nff-app .nff-meter {
        margin-bottom: 24px;
    }
    .nff-app .nff-title {
        font-size: 18px;
        margin-bottom: 22px;
    }
    .nff-app .nff-input {
        padding: 15px 18px;
        font-size: 17px;
    }
    .nff-app .nff-option-text {
        font-size: 13px;
        padding-top: 10px;
    }
    .nff-app .nff-option.nff-selected::after {
        top: 10px;
        inset-inline-start: 10px;
        width: 22px;
        height: 22px;
        background-size: 14px;
    }
    .nff-app .nff-buttons {
        margin-top: 22px;
        gap: 10px;
    }
    .nff-app .nff-btn {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 12px;
    }
    .nff-app .nff-btn-next,
    .nff-app .nff-btn-submit {
        flex: 1;
        justify-content: center;
    }
    .nff-app .nff-btn-back {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .nff-app .nff-meter-bar,
    .nff-app .nff-input,
    .nff-app .nff-option,
    .nff-app .nff-option-image img,
    .nff-app .nff-btn,
    .nff-app .nff-btn-arrow,
    .nff-app .nff-step { transition: none; animation: none; }
}

/* ============================================
   v1.4.0 — אופציות טקסט (שאלת גיל) + מסך חסימה
   ============================================ */

/* --- Text-only options (no image) --- */
.nff-app .nff-options-text {
    grid-template-columns: repeat(2, 1fr);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 560px) {
    .nff-app .nff-options-text { grid-template-columns: repeat(3, 1fr); }
}

.nff-app .nff-options-text .nff-option {
    padding: 0;
    min-height: 62px;
    align-items: center;
    justify-content: center;
}

.nff-app .nff-options-text .nff-option-text {
    padding: 18px 10px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
}

/* הסימון העגול קטן יותר באופציות טקסט כדי לא לדרוס את הכיתוב */
.nff-app .nff-options-text .nff-option.nff-selected::after {
    top: 50%;
    transform: translateY(-50%);
    inset-inline-start: 12px;
    width: 22px;
    height: 22px;
    background-size: 14px;
}

@keyframes nff-check-pop-y {
    0%   { transform: translateY(-50%) scale(0); opacity: 0; }
    60%  { transform: translateY(-50%) scale(1.15); opacity: 1; }
    100% { transform: translateY(-50%) scale(1); }
}

.nff-app .nff-options-text .nff-option.nff-selected::after {
    animation: nff-check-pop-y 300ms ease;
}

/* --- Blocked screen (לא זכאי לשירות) --- */
.nff-app .nff-blocked {
    background: #ffffff;
    border-radius: 20px;
    padding: 48px 36px;
    text-align: center;
    box-shadow:
        0 1px 3px rgba(17, 24, 39, 0.04),
        0 10px 30px -12px rgba(17, 24, 39, 0.08);
    border: 1px solid rgba(17, 24, 39, 0.05);
    outline: none;
    animation: nff-step-in 450ms cubic-bezier(.22, 1, .36, 1);
}

.nff-app .nff-blocked[hidden] { display: none !important; }

.nff-app .nff-blocked-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 18px;
}

.nff-app .nff-blocked-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 18px;
    color: #111827;
    letter-spacing: -0.01em;
}

.nff-app .nff-blocked-text {
    font-size: 16px;
    line-height: 1.7;
    color: #4b5563;
    max-width: 480px;
    margin: 0 auto 14px;
}

.nff-app .nff-blocked-text strong { color: #1e40af; }

.nff-app .nff-blocked-link {
    display: inline-block;
    margin-top: 18px;
    padding: 14px 32px;
    background: #2563eb;
    color: #ffffff !important;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 180ms, transform 180ms;
}

.nff-app .nff-blocked-link:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.nff-app.nff-is-blocked .nff-buttons { display: none !important; }
