/**
 * Nirmol MMS — Modern Training Application Form Styles
 * Responsive, accessible, WPForms-inspired frontend portal styling.
 */

.ntf-portal-wrap {
    --ntf-primary: #0d6b4f;
    --ntf-primary-hover: #09523c;
    --ntf-primary-soft: #f0faf5;
    --ntf-border: #cbd5e1;
    --ntf-border-focus: #0d6b4f;
    --ntf-bg: #ffffff;
    --ntf-surface: #f8fafc;
    --ntf-text: #0f172a;
    --ntf-muted: #64748b;
    --ntf-danger: #dc2626;
    --ntf-danger-soft: #fef2f2;
    --ntf-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--ntf-text);
    background: var(--ntf-bg);
    line-height: 1.5;
    box-sizing: border-box;
}

.ntf-portal-wrap *,
.ntf-portal-wrap *::before,
.ntf-portal-wrap *::after {
    box-sizing: border-box;
}

.ntf-form-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.ntf-form-title {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ntf-text);
    letter-spacing: -0.01em;
}

.ntf-form-subtitle {
    margin: 0;
    font-size: 0.92rem;
    color: var(--ntf-muted);
}

/* Member Profile Banner */
.ntf-member-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: linear-gradient(135deg, #f0faf5 0%, #ecfdf5 100%);
    border: 1px solid #a7f3d0;
    border-radius: var(--ntf-radius);
    padding: 12px 16px;
    margin-bottom: 22px;
}

.ntf-member-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ntf-member-avatar-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #d1fae5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.ntf-member-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #064e3b;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ntf-member-verified-pill {
    display: inline-flex;
    align-items: center;
    background: #0d6b4f;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
}

.ntf-member-meta {
    font-size: 0.82rem;
    color: #047857;
}

.ntf-member-id-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #065f46;
    background: #ffffff;
    border: 1px solid #6ee7b7;
    padding: 4px 10px;
    border-radius: 6px;
}

/* Multi-Step Wizard Progress */
.ntf-wizard-progress {
    margin-bottom: 24px;
}

.ntf-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 14px;
}

.ntf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d6b4f, #10b981);
    border-radius: 99px;
    transition: width 0.3s ease;
}

.ntf-steps-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ntf-step-pill {
    flex: 1 1 120px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: var(--ntf-surface);
    color: var(--ntf-muted);
    transition: all 0.2s ease;
}

.ntf-step-pill.active {
    border-color: var(--ntf-primary);
    background: var(--ntf-primary-soft);
    color: var(--ntf-primary);
}

.ntf-step-pill.completed {
    border-color: #6ee7b7;
    background: #ecfdf5;
    color: #065f46;
}

.ntf-step-pill.ntf-step-hidden {
    display: none !important;
}

.ntf-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ntf-step-pill.active .ntf-step-num {
    background: var(--ntf-primary);
    color: #ffffff;
}

.ntf-step-pill.completed .ntf-step-num {
    background: #10b981;
    color: #ffffff;
}

.ntf-step-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ntf-step-kicker {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    opacity: 0.8;
}

.ntf-step-title-txt {
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sections & Grid */
.ntf-section-step {
    display: none;
}

.ntf-section-step.active {
    display: block;
    animation: ntfFadeIn 0.2s ease-out;
}

@keyframes ntfFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ntf-section-header {
    margin: 8px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.ntf-section-title {
    margin: 0 0 4px;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ntf-primary);
}

.ntf-section-desc {
    margin: 0;
    font-size: 0.86rem;
    color: var(--ntf-muted);
}

.ntf-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px 16px;
    margin-bottom: 20px;
}

.ntf-col-12 { grid-column: span 12; }
.ntf-col-6  { grid-column: span 6; }
.ntf-col-4  { grid-column: span 4; }
.ntf-col-3  { grid-column: span 3; }

@media (max-width: 640px) {
    .ntf-col-6,
    .ntf-col-4,
    .ntf-col-3 {
        grid-column: span 12;
    }
}

/* Field Groups & Controls */
.ntf-field-group {
    display: flex;
    flex-direction: column;
}

.ntf-cond-hidden {
    display: none !important;
}

.ntf-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
}

.ntf-req-star {
    color: var(--ntf-danger);
    font-weight: 700;
    margin-left: 2px;
}

.ntf-req-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #b91c1c;
    background: #fee2e2;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.ntf-sync-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: #047857;
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

.ntf-control-wrap input[type="text"],
.ntf-control-wrap input[type="email"],
.ntf-control-wrap input[type="tel"],
.ntf-control-wrap input[type="url"],
.ntf-control-wrap input[type="number"],
.ntf-control-wrap input[type="date"],
.ntf-control-wrap input[type="time"],
.ntf-control-wrap select,
.ntf-control-wrap textarea,
.ntf-other-input {
    width: 100%;
    padding: 10px 13px;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--ntf-text);
    background: #ffffff;
    border: 1.5px solid var(--ntf-border);
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.ntf-control-wrap input:focus,
.ntf-control-wrap select:focus,
.ntf-control-wrap textarea:focus,
.ntf-other-input:focus {
    outline: none;
    border-color: var(--ntf-border-focus);
    box-shadow: 0 0 0 3px rgba(13, 107, 79, 0.14);
}

.ntf-input-readonly {
    background: #f1f5f9 !important;
    color: #475569 !important;
    cursor: not-allowed;
}

.ntf-select-search {
    margin-bottom: 6px !important;
    padding: 7px 11px !important;
    font-size: 0.84rem !important;
    background: #f8fafc !important;
}

.ntf-select-multiple {
    min-height: 110px;
}

/* Radio & Checkbox Choice Cards */
.ntf-choice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ntf-choice-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0;
}

.ntf-choice-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.ntf-choice-card input[type="radio"],
.ntf-choice-card input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--ntf-primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.ntf-choice-card:has(input:checked) {
    border-color: var(--ntf-primary);
    background: var(--ntf-primary-soft);
}

/* Compound Name & Address */
.ntf-subgrid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

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

.ntf-addr-full {
    grid-column: span 2;
}

@media (max-width: 520px) {
    .ntf-subgrid-2,
    .ntf-address-grid {
        grid-template-columns: 1fr;
    }
    .ntf-addr-full {
        grid-column: span 1;
    }
}

.ntf-sublabel {
    display: block;
    font-size: 0.75rem;
    color: var(--ntf-muted);
    margin-top: 3px;
}

/* File Upload Dropzone */
.ntf-upload-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ntf-upload-dropzone:hover,
.ntf-upload-dropzone.dragover {
    border-color: var(--ntf-primary);
    background: var(--ntf-primary-soft);
}

.ntf-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.ntf-upload-icon {
    font-size: 1.7rem;
    margin-bottom: 4px;
}

.ntf-upload-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.ntf-browse-link {
    color: var(--ntf-primary);
    text-decoration: underline;
}

.ntf-upload-meta {
    font-size: 0.78rem;
    color: var(--ntf-muted);
    margin-top: 4px;
}

.ntf-upload-file-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.ntf-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f172a;
}

/* Rating Stars */
.ntf-rating-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ntf-star-btn {
    background: none;
    border: none;
    font-size: 1.65rem;
    line-height: 1;
    color: #cbd5e1;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.1s ease, color 0.15s ease;
}

.ntf-star-btn:hover,
.ntf-star-btn.active {
    color: #f59e0b;
    transform: scale(1.1);
}

.ntf-rating-caption {
    font-size: 0.82rem;
    color: var(--ntf-muted);
    margin-left: 6px;
    font-weight: 600;
}

/* Signature Pad */
.ntf-sig-wrap {
    border: 1.5px solid var(--ntf-border);
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.ntf-sig-canvas {
    display: block;
    width: 100%;
    height: 140px;
    touch-action: none;
    cursor: crosshair;
    background: #ffffff;
}

.ntf-sig-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.78rem;
    color: var(--ntf-muted);
}

.ntf-sig-clear {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
}

.ntf-sig-clear:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Layout Elements */
.ntf-layout-heading h5 {
    margin: 6px 0 4px;
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 2px solid var(--ntf-primary);
    display: inline-block;
    padding-bottom: 3px;
}

.ntf-layout-heading p {
    margin: 4px 0 0;
    font-size: 0.84rem;
    color: var(--ntf-muted);
}

.ntf-divider-line {
    border: none;
    border-top: 1.5px solid #e2e8f0;
    margin: 6px 0;
}

.ntf-html-callout {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 15px;
    color: #1e3a8a;
    font-size: 0.88rem;
}

.ntf-html-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.ntf-html-body p:last-child {
    margin-bottom: 0;
}

/* Help, Errors, Privacy & Terms */
.ntf-help-text {
    font-size: 0.79rem;
    color: var(--ntf-muted);
    margin-top: 5px;
}

.ntf-field-error {
    display: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ntf-danger);
    margin-top: 5px;
}

.ntf-has-error .ntf-field-error {
    display: block;
}

.ntf-has-error input,
.ntf-has-error select,
.ntf-has-error textarea,
.ntf-has-error .ntf-upload-dropzone,
.ntf-has-error .ntf-sig-wrap {
    border-color: var(--ntf-danger) !important;
    background-color: var(--ntf-danger-soft);
}

.ntf-privacy-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 14px;
}

.ntf-terms-box {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.ntf-terms-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    margin: 0;
}

.ntf-terms-label input {
    margin-top: 3px;
    width: 17px;
    height: 17px;
    accent-color: var(--ntf-primary);
    flex-shrink: 0;
}

/* Feedback & Alerts */
.ntf-alert,
.ntf-form-feedback {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.ntf-alert-error,
.ntf-form-feedback.ntf-err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.ntf-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.ntf-form-feedback.ntf-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* Footer & Buttons */
.ntf-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ntf-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.ntf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.15s ease;
    font-family: inherit;
}

.ntf-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ntf-btn-primary {
    background: var(--ntf-primary);
    color: #ffffff;
}

.ntf-btn-primary:hover:not(:disabled) {
    background: var(--ntf-primary-hover);
}

.ntf-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.ntf-btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.ntf-btn-ghost {
    background: transparent;
    color: #64748b;
    border-color: #cbd5e1;
}

.ntf-btn-ghost:hover:not(:disabled) {
    background: #f8fafc;
    color: #0f172a;
}

.ntf-btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ntfSpin 0.7s linear infinite;
}

@keyframes ntfSpin {
    to { transform: rotate(360deg); }
}

/* Success Screen */
.ntf-success-screen {
    text-align: center;
    padding: 36px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}

.ntf-success-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.ntf-success-heading {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: #14532d;
}

.ntf-success-text {
    margin: 0 0 16px;
    color: #166534;
    font-size: 0.95rem;
}

.ntf-success-ref-wrap {
    display: inline-block;
    background: #ffffff;
    border: 1px solid #86efac;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #15803d;
}
