/* fm-forms.css — Front-end modern UI (FinMart)
   Brand blue: #002857 and white; soft accents; mobile-first layout.
*/

:root {
    --fm-blue: #002857;
    --fm-accent: #0077cc;
    --fm-bg: #ffffff;
    --fm-ghost: #f5f8fb;
    --fm-muted: #657085;
    --fm-radius: 5px;
    --fm-gap: 16px;
    --fm-padding: 18px;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* outer container */
#fm-combined-forms {
    margin: 28px auto;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border-radius: 14px;
    padding: 22px 0px;
    border: 1px solid rgba(0, 40, 87, 0.05);
    box-shadow: 0 10px 30px rgba(2, 40, 87, 0.04);
}

/* top selector row */
.fm-top {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.fm-top label {
    font-weight: 700;
    color: var(--fm-blue);
    font-size: 16px;
}

#fm_select_form {
    min-width: 260px;
    padding: 10px 12px;
    border-radius: var(--fm-radius);
    border: 1px solid #000;
    background: #fff;
    outline: none;
    font-weight: 600;
}

#fm_select_form:focus {
    box-shadow: 0 8px 24px rgba(0, 40, 87, 0.06);
    border-color: var(--fm-accent);
}

/* step card */
.fm-step {
    display: none;
    background: linear-gradient(180deg, #fff, #fbfdff);
    border-radius: var(--fm-radius);
    padding: 18px 0px;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 40, 87, 0.04);
}

.fm-step.active {
    display: block;
}

/* headings */
.fm-step h3 {
    margin: 0 0 12px 0;
    color: var(--fm-blue);
    font-size: 18px;
}

/* fields */
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.field label {
    font-weight: 600;
    color: #17324d;
    font-size: 13px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field input[type="date"],
.field select {
    padding: 10px 12px;
    border-radius: var(--fm-radius);
    border: 1px solid rgba(2, 40, 87, 0.06);
    background: var(--fm-ghost);
    outline: none;
    font-size: 14px;
}

.field input[type="file"] {
    padding: 6px;
}

/* placeholder subtle */
.field input::placeholder {
    color: #9aa6b7;
}

/* actions */
.fm-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.fm-btn {
    padding: 10px 16px;
    border-radius: var(--fm-radius);
    border: none;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(180deg, var(--fm-blue), #003a89);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 40, 87, 0.08);
}

.fm-btn.secondary {
    background: transparent;
    color: var(--fm-blue);
    border: 1px solid rgba(0, 40, 87, 0.08);
    box-shadow: none;
}

/* progress / step indicator (simple) */
.fm-progress {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0 16px 0;
}

.fm-progress .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e6eef9;
}

.fm-progress .dot.active {
    background: var(--fm-blue);
    transform: scale(1.15);
}

/* thanks */
.fm-thanks {
    text-align: center;
    padding: 20px;
    border-radius: var(--fm-radius);
    background: linear-gradient(180deg, #f7fffb, #ffffff);
    border: 1px solid rgba(0, 120, 100, 0.04);
}

/* small screens */
@media (max-width:720px) {
    #fm-combined-forms {
        padding: 14px;
        border-radius: var(--fm-radius);
    }

    .fm-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .fm-actions {
        flex-direction: column;
        width: 100%;
    }

    .fm-actions .fm-btn {
        width: 100%;
        text-align: center;
    }
}

/* accessibility / focus states for keyboard users */
.field input:focus,
.field select:focus {
    box-shadow: 0 8px 24px rgba(0, 120, 204, 0.08);
    border-color: var(--fm-accent);
}

/* subtle helper text */
.field .helper {
    color: var(--fm-muted);
    font-size: 13px;
    margin-top: 6px;
}

/* file link styling in admin view if shown */
.fm-file-link {
    display: inline-block;
    padding: 6px 8px;
    background: #f0f6ff;
    border-radius: var(--fm-radius);
    color: var(--fm-blue);
    text-decoration: none;
    border: 1px solid #e6f0ff;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field input[type="file"],
.field input[type="date"],
.field select {
    padding: 10px 12px;
    margin-bottom: 0px;
    border-radius: var(--fm-radius);
    background: #fff;
    border: 1px solid #000;
    /* NEW BORDER */
    font-size: 14px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

/* Focus border (FinMart blue) */
.field input:focus,
.field select:focus {
    border-color: #002857;
    /* FINMART BLUE */
    box-shadow: 0 0 0 3px rgba(0, 40, 87, 0.12);
}
/* Inline validation error styles */
.field.invalid input,
.field.invalid select,
.field.invalid textarea {
    border-color: #d64545 !important;
    /* red border */
    box-shadow: 0 6px 18px rgba(214, 69, 69, 0.06);
}

.fm-inline-error {
    color: #9b2c2c;
    background: #fff6f6;
    border: 1px solid rgba(214, 69, 69, 0.12);
    padding: 0;
    margin-top: 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
}

/* top summary error (if needed) */
.fm-error-summary {
    background: #fff3f3;
    border: 1px solid rgba(214, 69, 69, 0.12);
    color: #9b2c2c;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* subtle shake animation for attention when validation fails (optional) */
@keyframes fm-shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    50% {
        transform: translateX(6px);
    }

    75% {
        transform: translateX(-4px);
    }

    100% {
        transform: translateX(0);
    }
}

.field.invalid.shake {
    animation: fm-shake 360ms ease;
}
.fm-agent-login-wrapper,
.fm-agent-dashboard {
    margin: 24px auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0, 40, 87, 0.08);
    box-shadow: 0 10px 25px rgba(0, 40, 87, 0.05);
    padding: 20px 0px;
}

.fm-agent-login-wrapper h2,
.fm-agent-dashboard h2 {
    color: #002857;
    margin-top: 0;
}

.fm-agent-dashboard-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.fm-agent-dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fm-btn.fm-btn-primary {
    padding: 10px 16px;
    border-radius: var(--fm-radius);;
    background: linear-gradient(180deg, #002857, #004a9f);
    color: #fff;
    font-weight: 600;
    border: none;
    text-decoration: none;
    cursor: pointer;
}

.fm-btn.fm-btn-secondary {
    padding: 10px 14px;
    border-radius: var(--fm-radius);;
    border: 1px solid #002857;
    background: #f8faff;
    color: #002857;
    text-decoration: none;
    font-weight: 500;
}

.fm-agent-leads-table-wrapper {
    margin-top: 12px;
    overflow-x: auto;
}

.fm-agent-leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fm-agent-leads-table th,
.fm-agent-leads-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e9f4;
}

.fm-agent-leads-table th {
    text-align: left;
    background: #f5f7fb;
    color: #002857;
    font-weight: 600;
}

@media (max-width: 720px) {
    .fm-agent-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .fm-agent-dashboard-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.fm-step.fm-step-hidden {
    display: none;
}

.field.fm-cond-hidden {
    display: none;
}
.fm-choice.fm-choice-radio {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fm-filter-group select {
    padding: 10px 2px;
    border-radius: var(--fm-radius);
}

form.fm-agent-filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fm-modal-header {
    display: flex;
    justify-content: space-between;
    background: #002a5d;
    color: #fff;
    padding: 10px;
}

.fm-modal-dialog {
    margin-top: 20px;
    border: 1px solid;
    /* padding: 20px; */
}

.fm-modal-body {
    padding: 20px;
}

.fm-modal-footer {
    padding: 20px;
    display: flex;
    justify-content: end;
}

dl#fm-modal-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
