.smart-n400-section {
    max-width: 900px;
    margin: 24px auto;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.smart-n400-section[hidden] {
    display: none !important;
}

.n400-header {
    margin-bottom: 24px;
}

#n400-progress-text {
    margin: 0 0 8px;
    font-weight: 700;
}

.n400-progress-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    background: #e9ecef;
    border-radius: 999px;
    margin-bottom: 20px;
}

.n400-progress-bar {
    height: 100%;
    background: #1f6feb;
    border-radius: 999px;
    transition: width 0.3s ease;
}

#n400-section-title {
    margin: 0 0 8px;
    font-size: 1.7rem;
}

#n400-section-description {
    margin: 0;
    line-height: 1.6;
}

#n400-page-content {
    margin-top: 24px;
}

.n400-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-top: 28px;
}

.n400-navigation button {
    min-height: 46px;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

#n400-back-btn {
    background: #e9ecef;
}

#n400-save-btn {
    background: #fff3cd;
}

#n400-next-btn {
    background: #1f6feb;
    color: #ffffff;
}

#n400-save-status {
    min-height: 24px;
    margin-top: 14px;
    text-align: center;
    font-weight: 700;
}

@media (max-width: 600px) {
    .smart-n400-section {
        margin: 12px;
        padding: 18px;
    }

    .n400-navigation {
        flex-direction: column;
    }

    .n400-navigation button {
        width: 100%;
    }
}
/* Keep the official N-400 layout left-to-right */
#smart-n400-section {
    direction: ltr;
    text-align: left;
}

.n400-question-group {
    width: 100%;
    margin-bottom: 22px;
}

.n400-question-group label,
.n400-question-text {
    display: block;
    width: 100%;
}

/* Official English text */
.n400-official-text {
    display: block !important;
    width: 100%;
    direction: ltr;
    text-align: left;
    color: #111827;
    font-weight: 700;
    line-height: 1.5;
}

/* Translation under the official English */
.n400-translation-text {
    display: block !important;
    width: 100%;
    margin-top: 4px;
    direction: rtl;
    text-align: right;
    color: #c62828;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
}

/* Form fields */
.n400-question-group input,
.n400-question-group select,
.n400-question-group textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    padding: 12px;
    direction: ltr;
    text-align: left;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
}
.n400-choice-english,
.n400-choice-translation {
    display: block;
    line-height: 1.3;
}

.n400-choice-english {
    direction: ltr;
}

.n400-choice-translation {
    margin-top: 2px;
    color: #c62828;
    direction: rtl;
    font-size: 0.85rem;
}
.n400-yes-no {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.n400-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 105px;
    padding: 10px 14px;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
}

.n400-choice.selected {
    border-color: #1f6feb;
    background: #eaf2ff;
}

.n400-choice-square {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 2px solid #475569;
    border-radius: 4px;
    font-weight: 900;
}

.n400-choice-text {
    display: block;
}

.n400-choice-english {
    display: block;
    color: #111827;
    font-weight: 700;
    line-height: 1.2;
}

.n400-choice-translation {
    display: block;
    margin-top: 3px;
    color: #c62828;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    direction: rtl;
}
.n400-conditional-box {
    margin-top: 18px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
}

.n400-repeat-item {
    position: relative;
    margin-bottom: 14px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #d7dee8;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.n400-repeat-item label {
    display: block;
    margin-bottom: 10px;
    color: #1f2937;
    font-weight: 700;
}

.n400-repeat-item input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
}

.n400-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.n400-remove-button:hover {
    background: #ffe4e6;
}

.n400-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
    padding: 12px 16px;
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px dashed #7da2f6;
    border-radius: 11px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.n400-add-button:hover {
    background: #e0ebff;
}
.n400-button-english,
.n400-button-translation {
    display: block;
    line-height: 1.25;
}

.n400-button-english {
    direction: ltr;
    text-align: center;
}

.n400-button-translation {
    margin-top: 3px;
    direction: rtl;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
}

.n400-add-button .n400-button-translation {
    color: #1d4ed8;
}

.n400-remove-button .n400-button-translation {
    color: #be123c;
}
.n400-sensitive-box {
    margin-top: 18px;
    padding: 16px;
    background: #fff8e6;
    border: 1px solid #f3d28b;
    border-radius: 12px;
}

.n400-sensitive-box strong {
    display: block;
    margin-bottom: 8px;
}

.n400-sensitive-box p {
    margin: 0;
}

.n400-sensitive-box .n400-translation-text {
    margin-top: 5px;
}
.n400-page-card {
    margin-bottom: 22px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05);
}

.n400-card-heading {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.n400-card-heading h3,
.n400-page-card h4 {
    margin: 0 0 10px;
}

.n400-card-heading p {
    margin: 0;
}

.n400-name-grid,
.n400-two-column-grid {
    display: grid;
    gap: 18px;
}

.n400-name-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.n400-two-column-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.n400-help-text {
    margin: 8px 0 14px;
    padding: 12px;
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
}

.n400-field-note {
    display: block;
    margin-top: 7px;
}

.n400-field-note .n400-official-text {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
}

.n400-field-note .n400-translation-text {
    font-size: 0.82rem;
}

.n400-privacy-section {
    background: #fffbeb;
    border-color: #f4d58d;
}

.n400-privacy-section .n400-sensitive-box {
    background: #ffffff;
}

@media (max-width: 750px) {
    .n400-name-grid,
    .n400-two-column-grid {
        grid-template-columns: 1fr;
    }

    .n400-page-card {
        padding: 16px;
    }
}

.n400-single-choice-list {
    display: grid;
    gap: 14px;
}

.n400-eligibility-option {
    display: grid;
    grid-template-columns: 48px 1fr 28px;
    gap: 14px;
    align-items: start;
    width: 100%;
    padding: 18px;
    background: #ffffff;
    border: 2px solid #dbe3ee;
    border-radius: 14px;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.n400-eligibility-option:hover {
    border-color: #93b4ef;
    transform: translateY(-1px);
}

.n400-eligibility-option.selected {
    background: #eef5ff;
    border-color: #1f6feb;
}

.n400-eligibility-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #edf2f7;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 900;
}

.n400-eligibility-option.selected
.n400-eligibility-letter {
    background: #1f6feb;
    color: #ffffff;
}

.n400-eligibility-description {
    display: block;
    margin-top: 8px;
}

.n400-eligibility-description
.n400-official-text {
    color: #475569;
    font-size: 0.92rem;
    font-weight: 500;
}

.n400-eligibility-description
.n400-translation-text {
    font-size: 0.88rem;
}

.n400-eligibility-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid #64748b;
    border-radius: 5px;
    font-weight: 900;
}

.n400-eligibility-option.selected
.n400-eligibility-check {
    background: #1f6feb;
    border-color: #1f6feb;
    color: #ffffff;
}

.n400-warning-card {
    background: #fff8e6;
    border-color: #f3d28b;
}
.n400-address-fields {
    margin-bottom: 18px;
}

.n400-address-list {
    display: grid;
    gap: 18px;
    margin-bottom: 18px;
}

.n400-address-item {
    padding: 18px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #f8fafc;
}

.n400-repeat-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.n400-repeat-heading h4 {
    flex: 1;
    margin: 0;
}

.n400-current-date-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 12px;
    background: #eef5ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}

.n400-full-width {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .n400-repeat-heading {
        flex-direction: column;
    }

    .n400-repeat-heading
    .n400-remove-button {
        width: 100%;
    }
}