/* =========================================
   Flowbite-like (CSS puro) - Bootstrap 3 friendly
   ========================================= */

:root {
    /* Cores (ajuste pra bater no seu design system) */
    --fb-bg: #ffffff;
    --fb-surface: #f9fafb;              /* bg-neutral-secondary-medium */
    --fb-border: #d1d5db;               /* border-default-medium */
    --fb-text: #111827;                 /* text-heading */
    --fb-text-muted:#d1d5db;           /* placeholder/text-body */
    --fb-brand: #171818;                /* brand */
    --fb-brand-strong: #1d4ed8;         /* brand-strong */
    --fb-ring: rgba(37, 99, 235, 0.35); /* focus ring */
    --fb-ring-soft: rgba(37, 99, 235, 0.25);

    /* Layout */
    --fb-radius: 5px;                   /* rounded-base */
    --fb-radius-xs: 6px;                /* rounded-xs */
    --fb-font-size: 14px;               /* text-sm */
    --fb-line-height: 20px;             /* leading-5-ish */
    --fb-pad-y: 10px;                   /* py-2.5 */
    --fb-pad-x: 12px;                   /* px-3 */
    --fb-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);

    /* Acessibilidade */
    --fb-focus-outline: none;
}

/* ---------- Grid semelhante ao exemplo ---------- */
.fb-scope .fb-grid {
    display: grid;
    gap: 24px; /* gap-6 */
    margin-bottom: 24px; /* mb-6 */
}

@media (min-width: 992px) { /* bootstrap md ~ 992 */
    .fb-scope .fb-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Labels ---------- */
.fb-scope .fb-label,
.fb-scope label {
    display: block;
    margin: 0 0 10px; /* mb-2.5 */
    font-size: 14px;
    font-weight: 600;
    color: var(--fb-text);
}

/* ---------- Inputs (text, email, tel, url, number, password) ---------- */
.fb-scope .fb-input,
.fb-scope .form-control,
.fb-scope textarea,
.fb-scope select {
    display: block;
    width: 100%;
    box-sizing: border-box;

    background: var(--fb-surface);
    border: 1px solid var(--fb-border);
    color: var(--fb-text);

    font-size: var(--fb-font-size);
    line-height: var(--fb-line-height);

    padding: var(--fb-pad-y) var(--fb-pad-x);
    border-radius: var(--fb-radius);

    box-shadow: var(--fb-shadow-xs);

    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Override legacy input-segoo border-only style inside scope */
.fb-scope .input-segoo {
    margin-top: 0 !important;
    background: var(--fb-surface) !important;
    border: 1px solid var(--fb-border) !important;
    border-radius: var(--fb-radius) !important;
    box-shadow: var(--fb-shadow-xs) !important;
}

.fb-scope .input-segoo-search {
    margin-top: 0 !important;
    background: var(--fb-surface) !important;
    border: 1px solid var(--fb-border) !important;
    border-radius: var(--fb-radius) !important;
    box-shadow: var(--fb-shadow-xs) !important;
}

/* Placeholder */
.fb-scope .fb-input::placeholder,
.fb-scope .form-control::placeholder,
.fb-scope textarea::placeholder {
    color: var(--fb-text-muted);
    opacity: 1;
}

/* Focus */
.fb-scope .fb-input:focus,
.fb-scope .form-control:focus,
.fb-scope textarea:focus,
.fb-scope select:focus {
    outline: var(--fb-focus-outline);
    border-color: var(--fb-brand);
    box-shadow: 0 0 0 4px var(--fb-ring), var(--fb-shadow-xs);
    background: var(--fb-bg);
}

.fb-scope .input-segoo:focus {
    border-color: var(--fb-brand) !important;
    box-shadow: 0 0 0 4px var(--fb-ring), var(--fb-shadow-xs) !important;
    background: var(--fb-bg) !important;
}

/* Disabled */
.fb-scope .fb-input:disabled,
.fb-scope .form-control:disabled,
.fb-scope textarea:disabled,
.fb-scope select:disabled,
.fb-scope fieldset[disabled] .form-control {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Estado inválido (opcional, se você quiser acoplar com ng-invalid) */
.fb-scope .fb-input.fb-invalid,
.fb-scope .ng-invalid.ng-touched .fb-input,
.fb-scope .ng-invalid.ng-touched.form-control,
.fb-scope .fb-input:invalid {
    border-color: #ef4444;
}

.fb-scope .input-segoo-error {
    margin-top: 0 !important;
    background: var(--fb-surface) !important;
    border: 1px solid #ef4444 !important;
    border-radius: var(--fb-radius) !important;
    box-shadow: var(--fb-shadow-xs) !important;
}

.fb-scope .fb-input.fb-invalid:focus,
.fb-scope .ng-invalid.ng-touched .fb-input:focus,
.fb-scope .ng-invalid.ng-touched.form-control:focus,
.fb-scope .fb-input:invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25), var(--fb-shadow-xs);
}

.fb-scope .input-segoo-error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25), var(--fb-shadow-xs) !important;
}

/* ---------- Checkbox ---------- */
.fb-scope .fb-check {
    width: 16px; /* w-4 */
    height: 16px; /* h-4 */
    margin: 0;
    vertical-align: middle;

    background: var(--fb-surface);
    border: 1px solid var(--fb-border);
    border-radius: var(--fb-radius-xs);

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    display: inline-block;
    position: relative;

    transition: box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.fb-scope .fb-check:checked {
    background: var(--fb-brand);
    border-color: var(--fb-brand);
}

.fb-scope .fb-check:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}

.fb-scope .fb-check:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--fb-ring-soft);
    border-color: var(--fb-brand);
}

/* Linha do checkbox (flex items-start) */
.fb-scope .fb-checkrow {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 24px;
}

.fb-scope .fb-checkrow .fb-checkwrap {
    line-height: 1;
    padding-top: 2px; /* aproxima do "h-5" */
}

.fb-scope .fb-checkrow .fb-checklabel {
    font-size: 14px;
    font-weight: 600;
    color: var(--fb-text);
}

/* Link */
.fb-scope .fb-link {
    color: var(--fb-brand);
    text-decoration: none;
}

.fb-scope .fb-link:hover {
    text-decoration: underline;
}

/* ---------- Botão ---------- */
.fb-scope .btn.fb-btn,
.fb-scope .btn.fb-btn-primary {
    display: inline-block;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: var(--fb-radius);
    padding: 10px 16px; /* py-2.5 px-4 */
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: #fff;
    background: var(--fb-brand);
    box-shadow: var(--fb-shadow-xs);
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.fb-scope .btn.fb-btn:hover,
.fb-scope .btn.fb-btn-primary:hover {
    background: var(--fb-brand-strong);
}

.fb-scope .btn.fb-btn:focus,
.fb-scope .btn.fb-btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--fb-ring), var(--fb-shadow-xs);
}

/* ---------- Botões globais (mantendo cores) ---------- */
.fb-scope .btn {
    border-radius: var(--fb-radius);
    box-shadow: var(--fb-shadow-xs);
    font-weight: 600;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.fb-scope .btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--fb-ring), var(--fb-shadow-xs);
}

.fb-scope .btn:not(.btn-xs):not(.btn-sm):not(.btn-lg):not(.btn-circle) {    
    line-height: 20px;
}

.fb-scope .btn-circle {
    border-radius: var(--fb-radius);
    width: auto;
    height: auto;
    padding: 6px 12px;
    line-height: 20px;
}

.fb-scope .btn-circle.btn-sm {
    padding: 4px 10px;
}

.fb-scope .btn-circle.btn-lg {
    padding: 10px 16px;
}

.fb-scope .btn-circle > i {
    line-height: 1;
}

/* ---------- Input group (data/search) ---------- */
.fb-scope .fb-input-group {
    display: table;
    width: 100%;
    border-collapse: separate;
}

.fb-scope .fb-input-group .form-control,
.fb-scope .fb-input-group .fb-input {
    height: 40px;
    padding: 12px 14px;
    border: 1px solid var(--fb-border);
    border-right: 0 !important;
    border-radius: var(--fb-radius) 0 0 var(--fb-radius);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background: var(--fb-bg);
    color: #000;
    box-shadow: var(--fb-shadow-xs);
}

.fb-scope .fb-input-group .form-control:focus,
.fb-scope .fb-input-group .fb-input:focus {
    border-color: var(--fb-brand);
    box-shadow: 0 0 0 4px var(--fb-ring), var(--fb-shadow-xs);
}

.fb-scope .fb-input-group .input-segoo,
.fb-scope .fb-input-group .input-segoo:focus {
    border-right: 0 !important;
}

.fb-scope .fb-input-group .input-group-btn .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--fb-border);
    border-left: 0 !important;
    border-radius: 0 var(--fb-radius) var(--fb-radius) 0;
    background: #eef2f7;
    color: #000;
    box-shadow: var(--fb-shadow-xs);
}

.fb-scope .fb-input-group .input-group-btn .btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--fb-ring), var(--fb-shadow-xs);
}

.fb-scope .fb-input-group .input-group-btn .material-icons-outlined {
    font-size: 1.8rem;
    line-height: 1;
    color: #000;
}

/* ---------- Utilitários (mb-6, etc.) ---------- */
.fb-scope .fb-mb-6 { margin-bottom: 24px; }
