/* Campos e botões usados pelo cadastro público e pelo painel */
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.field.full {
    grid-column: 1 / -1;
}

.field-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
}

.field-label em {
    font-style: normal;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.input {
    width: 100%;
    padding: 13px 16px;
    background: var(--light);
    border: 2px solid transparent;
    border-radius: 14px;
    font: inherit;
    font-size: 1rem;
    color: var(--dark);
    outline: none;
    transition: 0.2s;
}

.input:hover {
    border-color: #e2e8f0;
}

.input:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.18);
}

textarea.input {
    resize: vertical;
    min-height: 80px;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--gray);
}

.field-error {
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 600;
}

.has-error .input,
.has-error .chip-list {
    border-color: #fca5a5;
}

/* Categorias em etiquetas */
.chip-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 12px;
    background: var(--light);
    border-radius: 16px;
    border: 2px solid transparent;
    scrollbar-width: thin;
}

.chip-group + .chip-group {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    position: relative;
    cursor: pointer;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip span {
    display: block;
    padding: 7px 14px;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: 0.2s;
}

.chip:first-child span {
    font-weight: 800;
}

.chip:hover span {
    border-color: var(--primary);
}

.chip input:checked + span {
    background: var(--primary);
    border-color: var(--primary);
}

.chip input:focus-visible + span {
    outline: 2px solid var(--dark);
    outline-offset: 2px;
}

.chip input:disabled + span {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Horários */
.hours-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hours-row {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--light);
    border-radius: 14px;
    min-height: 58px;
}

.hours-row .shifts,
.hours-row .shift-toggle,
.hours-row.is-open .closed-label {
    display: none;
}

.hours-row.is-open .shifts {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hours-row.is-open .shift-toggle {
    display: block;
}

.closed-label {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
}

.shift {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray);
}

.shift input {
    padding: 7px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    font: inherit;
    color: var(--dark);
    background: var(--white);
    min-width: 0;
}

.shift-toggle,
.link-button {
    background: none;
    border: none;
    color: var(--primary-dark);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.link-button {
    align-self: flex-start;
    padding: 4px 0;
}

.switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    position: relative;
}

.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    width: 36px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 50px;
    position: relative;
    flex-shrink: 0;
    transition: 0.2s;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--white);
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .switch-track {
    background: var(--primary);
}

.switch input:checked + .switch-track::after {
    transform: translateX(16px);
}

.switch input:focus-visible + .switch-track {
    outline: 2px solid var(--dark);
    outline-offset: 2px;
}

.btn-primary,
.btn-dark,
.btn-ghost,
.btn-danger {
    border: none;
    border-radius: 14px;
    padding: 13px 22px;
    font: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary { background: var(--primary); color: var(--dark); }
.btn-primary:hover { background: #eab308; }
.btn-dark { background: var(--dark); color: var(--white); }
.btn-dark:hover { background: var(--dark-light); }
.btn-ghost { background: #f1f5f9; color: var(--dark); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-danger { background: #fef2f2; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }

.btn-primary:disabled,
.btn-dark:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media (max-width: 560px) {
    .field-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .field-grid > .field {
        grid-column: 1;
    }

    .hours-row {
        grid-template-columns: 1fr auto;
        row-gap: 8px;
    }

    .hours-row .switch {
        grid-column: 1;
        grid-row: 1;
    }

    .hours-row .shifts {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .closed-label,
    .shift-toggle {
        grid-column: 2;
        grid-row: 1;
    }
}
